mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Atttypmod cleanups.
This commit is contained in:
parent
65faaf3046
commit
b33f080c26
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.37 1998/02/07 06:10:49 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.38 1998/02/07 21:41:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -315,6 +315,8 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
|
|||||||
funcTupDesc->attrs[0]->atttypid = retType;
|
funcTupDesc->attrs[0]->atttypid = retType;
|
||||||
funcTupDesc->attrs[0]->attnum = 1;
|
funcTupDesc->attrs[0]->attnum = 1;
|
||||||
funcTupDesc->attrs[0]->attbyval = ((TypeTupleForm) GETSTRUCT(tuple))->typbyval;
|
funcTupDesc->attrs[0]->attbyval = ((TypeTupleForm) GETSTRUCT(tuple))->typbyval;
|
||||||
|
funcTupDesc->attrs[0]->attcacheoff = -1;
|
||||||
|
funcTupDesc->attrs[0]->atttypmod = -1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* make the attributes name the same as the functions
|
* make the attributes name the same as the functions
|
||||||
@ -433,10 +435,10 @@ ConstructTupleDescriptor(Oid heapoid,
|
|||||||
memcpy(to, from, ATTRIBUTE_TUPLE_SIZE);
|
memcpy(to, from, ATTRIBUTE_TUPLE_SIZE);
|
||||||
|
|
||||||
((AttributeTupleForm) to)->attnum = i + 1;
|
((AttributeTupleForm) to)->attnum = i + 1;
|
||||||
((AttributeTupleForm) to)->attcacheoff = -1;
|
|
||||||
|
|
||||||
((AttributeTupleForm) to)->attnotnull = false;
|
((AttributeTupleForm) to)->attnotnull = false;
|
||||||
((AttributeTupleForm) to)->atthasdef = false;
|
((AttributeTupleForm) to)->atthasdef = false;
|
||||||
|
((AttributeTupleForm) to)->attcacheoff = -1;
|
||||||
((AttributeTupleForm) to)->atttypmod = -1;
|
((AttributeTupleForm) to)->atttypmod = -1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.24 1998/01/16 23:19:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.25 1998/02/07 21:41:52 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||||
@ -419,8 +419,6 @@ PerformAddAttribute(char *relationName,
|
|||||||
(Datum) NULL);
|
(Datum) NULL);
|
||||||
|
|
||||||
attributeD.attrelid = reltup->t_oid;
|
attributeD.attrelid = reltup->t_oid;
|
||||||
attributeD.attdisbursion = 0; /* XXX temporary */
|
|
||||||
attributeD.attcacheoff = -1;
|
|
||||||
|
|
||||||
attributeTuple = heap_addheader(Natts_pg_attribute,
|
attributeTuple = heap_addheader(Natts_pg_attribute,
|
||||||
sizeof attributeD,
|
sizeof attributeD,
|
||||||
@ -481,13 +479,15 @@ PerformAddAttribute(char *relationName,
|
|||||||
elog(ERROR, "Add: type \"%s\" nonexistent", p);
|
elog(ERROR, "Add: type \"%s\" nonexistent", p);
|
||||||
}
|
}
|
||||||
namestrcpy(&(attribute->attname), (char *) key[1].sk_argument);
|
namestrcpy(&(attribute->attname), (char *) key[1].sk_argument);
|
||||||
|
|
||||||
attribute->atttypid = typeTuple->t_oid;
|
attribute->atttypid = typeTuple->t_oid;
|
||||||
attribute->attlen = form->typlen;
|
attribute->attlen = form->typlen;
|
||||||
|
attributeD.attdisbursion = 0;
|
||||||
|
attribute->attcacheoff = -1;
|
||||||
attribute->atttypmod = colDef->typename->typmod;
|
attribute->atttypmod = colDef->typename->typmod;
|
||||||
attribute->attnum = i;
|
attribute->attnum = i;
|
||||||
attribute->attbyval = form->typbyval;
|
attribute->attbyval = form->typbyval;
|
||||||
attribute->attnelems = attnelems;
|
attribute->attnelems = attnelems;
|
||||||
attribute->attcacheoff = -1;
|
|
||||||
attribute->attisset = (bool) (form->typtype == 'c');
|
attribute->attisset = (bool) (form->typtype == 'c');
|
||||||
attribute->attalign = form->typalign;
|
attribute->attalign = form->typalign;
|
||||||
attribute->attnotnull = false;
|
attribute->attnotnull = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user