Get rid of attproc, atttyparg, attcanindex, attdefrel, attbound

from pg_attribute. atthasdef added.
This commit is contained in:
Vadim B. Mikheev 1997-08-21 01:32:19 +00:00
parent 63fbdd358f
commit e4247023f1
5 changed files with 54 additions and 90 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.14 1997/08/19 04:42:31 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.15 1997/08/21 01:31:24 vadim Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
@ -179,17 +179,15 @@ TupleDescInitEntry(TupleDesc desc,
memset(att->attname.data,0,NAMEDATALEN);
att->attdefrel = 0; /* dummy value */
att->attnvals = 0; /* dummy value */
att->atttyparg = 0; /* dummy value */
att->attbound = 0; /* dummy value */
att->attcanindex = 0; /* dummy value */
att->attproc = 0; /* dummy value */
att->attcacheoff = -1;
att->attnum = attributeNumber;
att->attnelems = attdim;
att->attisset = attisset;
att->attnotnull = false;
att->atthasdef = false;
/* ----------------
* search the system cache for the type tuple of the attribute

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.17 1997/08/19 21:30:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.18 1997/08/21 01:32:03 vadim Exp $
*
* INTERFACE ROUTINES
* heap_creatr() - Create an uncataloged heap relation
@ -84,58 +84,58 @@ static void addNewRelationType(char *typeName, Oid new_rel_oid);
*/
static FormData_pg_attribute a1 = {
0xffffffff, {"ctid"}, 27l, 0l, 0l, 0l, sizeof (ItemPointerData),
SelfItemPointerAttributeNumber, 0, '\0', '\001', 0l, 'i', '\0'
0xffffffff, {"ctid"}, 27l, 0l, sizeof (ItemPointerData),
SelfItemPointerAttributeNumber, 0, -1, '\0', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a2 = {
0xffffffff, {"oid"}, 26l, 0l, 0l, 0l, sizeof(Oid),
ObjectIdAttributeNumber, 0, '\001', '\001', 0l, 'i','\0'
0xffffffff, {"oid"}, 26l, 0l, sizeof(Oid),
ObjectIdAttributeNumber, 0, -1, '\001', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a3 = {
0xffffffff, {"xmin"}, 28l, 0l, 0l, 0l, sizeof (TransactionId),
MinTransactionIdAttributeNumber, 0, '\0', '\001', 0l, 'i', '\0'
0xffffffff, {"xmin"}, 28l, 0l, sizeof (TransactionId),
MinTransactionIdAttributeNumber, 0, -1, '\0', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a4 = {
0xffffffff, {"cmin"}, 29l, 0l, 0l, 0l, sizeof (CommandId),
MinCommandIdAttributeNumber, 0, '\001', '\001', 0l, 's', '\0'
0xffffffff, {"cmin"}, 29l, 0l, sizeof (CommandId),
MinCommandIdAttributeNumber, 0, -1, '\001', '\0', 's', '\0', '\0'
};
static FormData_pg_attribute a5 = {
0xffffffff, {"xmax"}, 28l, 0l, 0l, 0l, sizeof (TransactionId),
MaxTransactionIdAttributeNumber, 0, '\0', '\001', 0l, 'i', '\0'
0xffffffff, {"xmax"}, 28l, 0l, sizeof (TransactionId),
MaxTransactionIdAttributeNumber, 0, -1, '\0', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a6 = {
0xffffffff, {"cmax"}, 29l, 0l, 0l, 0l, sizeof (CommandId),
MaxCommandIdAttributeNumber, 0, '\001', '\001', 0l, 's', '\0'
0xffffffff, {"cmax"}, 29l, 0l, sizeof (CommandId),
MaxCommandIdAttributeNumber, 0, -1, '\001', '\0', 's', '\0', '\0'
};
static FormData_pg_attribute a7 = {
0xffffffff, {"chain"}, 27l, 0l, 0l, 0l, sizeof (ItemPointerData),
ChainItemPointerAttributeNumber, 0, '\0', '\001', 0l, 'i', '\0'
0xffffffff, {"chain"}, 27l, 0l, sizeof (ItemPointerData),
ChainItemPointerAttributeNumber, 0, -1, '\0', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a8 = {
0xffffffff, {"anchor"}, 27l, 0l, 0l, 0l, sizeof (ItemPointerData),
AnchorItemPointerAttributeNumber, 0, '\0', '\001', 0l, 'i', '\0'
0xffffffff, {"anchor"}, 27l, 0l, sizeof (ItemPointerData),
AnchorItemPointerAttributeNumber, 0, -1, '\0', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a9 = {
0xffffffff, {"tmin"}, 20l, 0l, 0l, 0l, sizeof (AbsoluteTime),
MinAbsoluteTimeAttributeNumber, 0, '\001', '\001', 0l, 'i', '\0'
0xffffffff, {"tmin"}, 702l, 0l, sizeof (AbsoluteTime),
MinAbsoluteTimeAttributeNumber, 0, -1, '\001', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a10 = {
0xffffffff, {"tmax"}, 20l, 0l, 0l, 0l, sizeof (AbsoluteTime),
MaxAbsoluteTimeAttributeNumber, 0, '\001', '\001', 0l, 'i', '\0'
0xffffffff, {"tmax"}, 702l, 0l, sizeof (AbsoluteTime),
MaxAbsoluteTimeAttributeNumber, 0, -1, '\001', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a11 = {
0xffffffff, {"vtype"}, 18l, 0l, 0l, 0l, sizeof (char),
VersionTypeAttributeNumber, 0, '\001', '\001', 0l, 'c', '\0'
0xffffffff, {"vtype"}, 18l, 0l, sizeof (char),
VersionTypeAttributeNumber, 0, -1, '\001', '\0', 'c', '\0', '\0'
};
static AttributeTupleForm HeapAtt[] =

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.17 1997/08/19 04:42:55 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.18 1997/08/21 01:32:04 vadim Exp $
*
*
* INTERFACE ROUTINES
@ -93,36 +93,35 @@ static void DefaultBuild(Relation heapRelation, Relation indexRelation,
* should be generated or eliminated or moved elsewhere. -cim 1/19/91
*
* typedef struct FormData_pg_attribute {
* Oid attrelid;
* Oid attrelid;
* NameData attname;
* Oid atttypid;
* Oid attdefrel;
* Oid atttypid;
* uint32 attnvals;
* Oid atttyparg; type arg for arrays/spquel/procs
* int16 attlen;
* AttrNumber attnum;
* uint16 attbound;
* uint32 attnelems;
* int32 attcacheoff;
* bool attbyval;
* bool attcanindex;
* Oid attproc; spquel?
* bool attisset;
* char attalign;
* bool attnotnull;
* bool atthasdef;
* } FormData_pg_attribute;
*
* The data in this table was taken from local1_template.ami
* but tmin and tmax were switched because local1 was incorrect.
* ----------------------------------------------------------------
*/
static FormData_pg_attribute sysatts[] = {
{ 0l, {"ctid"}, 27l, 0l, 0l, 0l, 6, -1, 0, '\0', '\001', 0l, 'i', '\0' },
{ 0l, {"oid"}, 26l, 0l, 0l, 0l, 4, -2, 0, '\001', '\001', 0l, 'i', '\0' },
{ 0l, {"xmin"}, 28l, 0l, 0l, 0l, 5, -3, 0, '\0', '\001', 0l, 'i', '\0' },
{ 0l, {"cmin"}, 29l, 0l, 0l, 0l, 1, -4, 0, '\001', '\001', 0l, 's', '\0' },
{ 0l, {"xmax"}, 28l, 0l, 0l, 0l, 5, -5, 0, '\0', '\001', 0l, 'i', '\0' },
{ 0l, {"cmax"}, 29l, 0l, 0l, 0l, 1, -6, 0, '\001', '\001', 0l, 's', '\0' },
{ 0l, {"chain"}, 27l, 0l, 0l, 0l, 6, -7, 0, '\0', '\001', 0l, 'i', '\0' },
{ 0l, {"anchor"}, 27l, 0l, 0l, 0l, 6, -8, 0, '\0', '\001', 0l, 'i', '\0' },
{ 0l, {"tmin"}, 20l, 0l, 0l, 0l, 4, -9, 0, '\001', '\001', 0l, 'i', '\0' },
{ 0l, {"tmax"}, 20l, 0l, 0l, 0l, 4, -10, 0, '\001', '\001', 0l, 'i', '\0' },
{ 0l, {"vtype"}, 18l, 0l, 0l, 0l, 1, -11, 0, '\001', '\001', 0l, 'c', '\0' },
{ 0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, '\0', '\0', 'i', '\0', '\0' },
{ 0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, '\001', '\0', 'i', '\0', '\0' },
{ 0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, '\0', '\0', 'i', '\0', '\0' },
{ 0l, {"cmin"}, 29l, 0l, 2, -4, 0, -1, '\001', '\0', 's', '\0', '\0' },
{ 0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, '\0', '\0', 'i', '\0', '\0' },
{ 0l, {"cmax"}, 29l, 0l, 2, -6, 0, -1, '\001', '\0', 's', '\0', '\0' },
{ 0l, {"chain"}, 27l, 0l, 6, -7, 0, -1, '\0', '\0', 'i', '\0', '\0' },
{ 0l, {"anchor"}, 27l, 0l, 6, -8, 0, -1, '\0', '\0', 'i', '\0', '\0' },
{ 0l, {"tmin"}, 702l, 0l, 4, -9, 0, -1, '\001', '\0', 'i', '\0', '\0' },
{ 0l, {"tmax"}, 702l, 0l, 4, -10, 0, -1, '\001', '\0', 'i', '\0', '\0' },
{ 0l, {"vtype"}, 18l, 0l, 1, -11, 0, -1, '\001', '\0', 'c', '\0', '\0' },
};
/* ----------------------------------------------------------------
@ -308,7 +307,6 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
funcTupDesc->attrs[0]->atttypid = retType;
funcTupDesc->attrs[0]->attnum = 1;
funcTupDesc->attrs[0]->attbyval = ((TypeTupleForm)GETSTRUCT(tuple))->typbyval;
funcTupDesc->attrs[0]->attcanindex = 0;
/*
* make the attributes name the same as the functions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.9 1997/01/10 20:16:47 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.10 1997/08/21 01:32:06 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@ -39,39 +39,9 @@
* pg_type
* pg_naming
* pg_class
* pg_attrdef
* pg_relcheck
*/
/*
static NameData AttributeNameIndexData = { "pg_attnameind" };
static NameData AttributeNumIndexData = { "pg_attnumind" };
static NameData AttributeRelidIndexData= { "pg_attrelidind" };
static NameData ProcedureNameIndexData = { "pg_procnameind" };
static NameData ProcedureOidIndexData = { "pg_procidind" };
static NameData ProcedureSrcIndexData = { "pg_procsrcind" };
static NameData TypeNameIndexData = { "pg_typenameind" };
static NameData TypeOidIndexData = { "pg_typeidind" };
static NameData ClassNameIndexData = { "pg_classnameind" };
static NameData ClassOidIndexData = { "pg_classoidind" };
Name AttributeNameIndex = &AttributeNameIndexData;
Name AttributeNumIndex = &AttributeNumIndexData;
Name AttributeRelidIndex= &AttributeRelidIndexData;
Name ProcedureNameIndex = &ProcedureNameIndexData;
Name ProcedureOidIndex = &ProcedureOidIndexData;
Name ProcedureSrcIndex = &ProcedureSrcIndexData;
Name TypeNameIndex = &TypeNameIndexData;
Name TypeOidIndex = &TypeOidIndexData;
Name ClassNameIndex = &ClassNameIndexData;
Name ClassOidIndex = &ClassOidIndexData;
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndexData.data,
AttributeNumIndexData.data,
AttributeRelidIndexData.data};
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndexData.data,
ProcedureOidIndexData.data,
ProcedureSrcIndexData.data};char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndexData.data,
TypeOidIndexData.data};
char *Name_pg_class_indices[Num_pg_class_indices]= {ClassNameIndexData.data,
ClassOidIndexData.data};
*/
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
AttributeNumIndex,
@ -83,6 +53,9 @@ char *Name_pg_type_indices[Num_pg_type_indices] = { TypeNameIndex,
TypeOidIndex};
char *Name_pg_class_indices[Num_pg_class_indices]= { ClassNameIndex,
ClassOidIndex};
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices]= { AttrDefaultIndex };
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices]= { RelCheckIndex };
static HeapTuple CatalogIndexFetchTuple(Relation heapRelation,

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.10 1997/08/19 04:43:27 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.11 1997/08/21 01:32:19 vadim Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
@ -382,12 +382,7 @@ PerformAddAttribute(char *relationName,
(Datum) NULL);
attributeD.attrelid = reltup->t_oid;
attributeD.attdefrel = InvalidOid; /* XXX temporary */
attributeD.attnvals = 0; /* XXX temporary */
attributeD.atttyparg = InvalidOid; /* XXX temporary */
attributeD.attbound = 0; /* XXX temporary */
attributeD.attcanindex = 0; /* XXX need this info */
attributeD.attproc = InvalidOid; /* XXX tempoirary */
attributeD.attcacheoff = -1;
attributeTuple = heap_addheader(Natts_pg_attribute,