summaryrefslogtreecommitdiff
path: root/src/backend/bootstrap
diff options
context:
space:
mode:
authorTom Lane2004-01-06 23:55:19 +0000
committerTom Lane2004-01-06 23:55:19 +0000
commita77e32d7c5615e302fbc87803086132f1dab99a9 (patch)
treeb03a6846d6909d6b1acb81c82a1e8fe3b98dbbb2 /src/backend/bootstrap
parent488f2785d025a6cc04685cfee4ca3eac0086e2fd (diff)
Apply the core parts of Dennis Bjorklund's patch to allow function
parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
Diffstat (limited to 'src/backend/bootstrap')
-rw-r--r--src/backend/bootstrap/bootstrap.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index b21f4cc8065..c1105f3b11e 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.173 2004/01/06 23:15:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.174 2004/01/06 23:55:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -130,6 +130,7 @@ static struct typinfo Procid[] = {
{"oidvector", OIDVECTOROID, 0, INDEX_MAX_KEYS * 4, F_OIDVECTORIN, F_OIDVECTOROUT},
{"smgr", 210, 0, 2, F_SMGRIN, F_SMGROUT},
{"_int4", 1007, INT4OID, -1, F_ARRAY_IN, F_ARRAY_OUT},
+ {"_text", 1009, TEXTOID, -1, F_ARRAY_IN, F_ARRAY_OUT},
{"_aclitem", 1034, 1033, -1, F_ARRAY_IN, F_ARRAY_OUT}
};
@@ -690,6 +691,11 @@ DefineAttr(char *name, char *type, int attnum)
attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
attrtypes[attnum]->attstorage = Ap->am_typ.typstorage;
attrtypes[attnum]->attalign = Ap->am_typ.typalign;
+ /* if an array type, assume 1-dimensional attribute */
+ if (Ap->am_typ.typelem != InvalidOid && Ap->am_typ.typlen < 0)
+ attrtypes[attnum]->attndims = 1;
+ else
+ attrtypes[attnum]->attndims = 0;
}
else
{
@@ -729,7 +735,14 @@ DefineAttr(char *name, char *type, int attnum)
attrtypes[attnum]->attalign = 'i';
break;
}
+ /* if an array type, assume 1-dimensional attribute */
+ if (Procid[typeoid].elem != InvalidOid && attlen < 0)
+ attrtypes[attnum]->attndims = 1;
+ else
+ attrtypes[attnum]->attndims = 0;
}
+
+ attrtypes[attnum]->attstattarget = -1;
attrtypes[attnum]->attcacheoff = -1;
attrtypes[attnum]->atttypmod = -1;
attrtypes[attnum]->attislocal = true;