Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite424702

Browse files
committed
Get rid of attproc, atttyparg, attcanindex, attdefrel, attbound
from pg_attribute. atthasdef added.
1 parent63fbdd3 commite424702

File tree

5 files changed

+54
-90
lines changed

5 files changed

+54
-90
lines changed

‎src/backend/access/common/tupdesc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.14 1997/08/19 04:42:31 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.15 1997/08/21 01:31:24 vadim Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -179,17 +179,15 @@ TupleDescInitEntry(TupleDesc desc,
179179
memset(att->attname.data,0,NAMEDATALEN);
180180

181181

182-
att->attdefrel=0;/* dummy value */
183182
att->attnvals=0;/* dummy value */
184-
att->atttyparg=0;/* dummy value */
185-
att->attbound=0;/* dummy value */
186-
att->attcanindex=0;/* dummy value */
187-
att->attproc=0;/* dummy value */
188183
att->attcacheoff=-1;
189184

190185
att->attnum=attributeNumber;
191186
att->attnelems=attdim;
192187
att->attisset=attisset;
188+
189+
att->attnotnull= false;
190+
att->atthasdef= false;
193191

194192
/* ----------------
195193
*search the system cache for the type tuple of the attribute

‎src/backend/catalog/heap.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.17 1997/08/19 21:30:30 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.18 1997/08/21 01:32:03 vadim Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
*heap_creatr()- Create an uncataloged heap relation
@@ -84,58 +84,58 @@ static void addNewRelationType(char *typeName, Oid new_rel_oid);
8484
*/
8585

8686
staticFormData_pg_attributea1= {
87-
0xffffffff, {"ctid"},27l,0l,0l,0l,sizeof (ItemPointerData),
88-
SelfItemPointerAttributeNumber,0,'\0','\001',0l,'i','\0'
87+
0xffffffff, {"ctid"},27l,0l,sizeof (ItemPointerData),
88+
SelfItemPointerAttributeNumber,0,-1,'\0','\0','i','\0','\0'
8989
};
9090

9191
staticFormData_pg_attributea2= {
92-
0xffffffff, {"oid"},26l,0l,0l,0l,sizeof(Oid),
93-
ObjectIdAttributeNumber,0,'\001','\001',0l,'i','\0'
92+
0xffffffff, {"oid"},26l,0l,sizeof(Oid),
93+
ObjectIdAttributeNumber,0,-1,'\001','\0','i','\0','\0'
9494
};
9595

9696
staticFormData_pg_attributea3= {
97-
0xffffffff, {"xmin"},28l,0l,0l,0l,sizeof (TransactionId),
98-
MinTransactionIdAttributeNumber,0,'\0','\001',0l,'i','\0'
97+
0xffffffff, {"xmin"},28l,0l,sizeof (TransactionId),
98+
MinTransactionIdAttributeNumber,0,-1,'\0','\0','i','\0','\0'
9999
};
100100

101101
staticFormData_pg_attributea4= {
102-
0xffffffff, {"cmin"},29l,0l,0l,0l,sizeof (CommandId),
103-
MinCommandIdAttributeNumber,0,'\001','\001',0l,'s','\0'
102+
0xffffffff, {"cmin"},29l,0l,sizeof (CommandId),
103+
MinCommandIdAttributeNumber,0,-1,'\001','\0','s','\0','\0'
104104
};
105105

106106
staticFormData_pg_attributea5= {
107-
0xffffffff, {"xmax"},28l,0l,0l,0l,sizeof (TransactionId),
108-
MaxTransactionIdAttributeNumber,0,'\0','\001',0l,'i','\0'
107+
0xffffffff, {"xmax"},28l,0l,sizeof (TransactionId),
108+
MaxTransactionIdAttributeNumber,0,-1,'\0','\0','i','\0','\0'
109109
};
110110

111111
staticFormData_pg_attributea6= {
112-
0xffffffff, {"cmax"},29l,0l,0l,0l,sizeof (CommandId),
113-
MaxCommandIdAttributeNumber,0,'\001','\001',0l,'s','\0'
112+
0xffffffff, {"cmax"},29l,0l,sizeof (CommandId),
113+
MaxCommandIdAttributeNumber,0,-1,'\001','\0','s','\0','\0'
114114
};
115115

116116
staticFormData_pg_attributea7= {
117-
0xffffffff, {"chain"},27l,0l,0l,0l,sizeof (ItemPointerData),
118-
ChainItemPointerAttributeNumber,0,'\0','\001',0l,'i','\0'
117+
0xffffffff, {"chain"},27l,0l,sizeof (ItemPointerData),
118+
ChainItemPointerAttributeNumber,0,-1,'\0','\0','i','\0','\0'
119119
};
120120

121121
staticFormData_pg_attributea8= {
122-
0xffffffff, {"anchor"},27l,0l,0l,0l,sizeof (ItemPointerData),
123-
AnchorItemPointerAttributeNumber,0,'\0','\001',0l,'i','\0'
122+
0xffffffff, {"anchor"},27l,0l,sizeof (ItemPointerData),
123+
AnchorItemPointerAttributeNumber,0,-1,'\0','\0','i','\0','\0'
124124
};
125125

126126
staticFormData_pg_attributea9= {
127-
0xffffffff, {"tmin"},20l,0l,0l,0l,sizeof (AbsoluteTime),
128-
MinAbsoluteTimeAttributeNumber,0,'\001','\001',0l,'i','\0'
127+
0xffffffff, {"tmin"},702l,0l,sizeof (AbsoluteTime),
128+
MinAbsoluteTimeAttributeNumber,0,-1,'\001','\0','i','\0','\0'
129129
};
130130

131131
staticFormData_pg_attributea10= {
132-
0xffffffff, {"tmax"},20l,0l,0l,0l,sizeof (AbsoluteTime),
133-
MaxAbsoluteTimeAttributeNumber,0,'\001','\001',0l,'i','\0'
132+
0xffffffff, {"tmax"},702l,0l,sizeof (AbsoluteTime),
133+
MaxAbsoluteTimeAttributeNumber,0,-1,'\001','\0','i','\0','\0'
134134
};
135135

136136
staticFormData_pg_attributea11= {
137-
0xffffffff, {"vtype"},18l,0l,0l,0l,sizeof (char),
138-
VersionTypeAttributeNumber,0,'\001','\001',0l,'c','\0'
137+
0xffffffff, {"vtype"},18l,0l,sizeof (char),
138+
VersionTypeAttributeNumber,0,-1,'\001','\0','c','\0','\0'
139139
};
140140

141141
staticAttributeTupleFormHeapAtt[]=

‎src/backend/catalog/index.c

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.17 1997/08/19 04:42:55 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.18 1997/08/21 01:32:04 vadim Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -93,36 +93,35 @@ static void DefaultBuild(Relation heapRelation, Relation indexRelation,
9393
* should be generated or eliminated or moved elsewhere. -cim 1/19/91
9494
*
9595
* typedef struct FormData_pg_attribute {
96-
*Oidattrelid;
96+
*Oidattrelid;
9797
*NameDataattname;
98-
*Oidatttypid;
99-
*Oidattdefrel;
98+
*Oidatttypid;
10099
*uint32attnvals;
101-
*Oidatttyparg;type arg for arrays/spquel/procs
102100
*int16attlen;
103101
*AttrNumberattnum;
104-
*uint16attbound;
102+
*uint32attnelems;
103+
*int32attcacheoff;
105104
*boolattbyval;
106-
*boolattcanindex;
107-
*Oidattproc;spquel?
105+
*boolattisset;
106+
*charattalign;
107+
*boolattnotnull;
108+
*boolatthasdef;
108109
* } FormData_pg_attribute;
109110
*
110-
* The data in this table was taken from local1_template.ami
111-
* but tmin and tmax were switched because local1 was incorrect.
112111
* ----------------------------------------------------------------
113112
*/
114113
staticFormData_pg_attributesysatts[]= {
115-
{0l, {"ctid"},27l,0l,0l,0l,6,-1,0,'\0','\001',0l,'i','\0' },
116-
{0l, {"oid"},26l,0l,0l,0l,4,-2,0,'\001','\001',0l,'i','\0' },
117-
{0l, {"xmin"},28l,0l,0l,0l,5,-3,0,'\0','\001',0l,'i','\0' },
118-
{0l, {"cmin"},29l,0l,0l,0l,1,-4,0,'\001','\001',0l,'s','\0' },
119-
{0l, {"xmax"},28l,0l,0l,0l,5,-5,0,'\0','\001',0l,'i','\0' },
120-
{0l, {"cmax"},29l,0l,0l,0l,1,-6,0,'\001','\001',0l,'s','\0' },
121-
{0l, {"chain"},27l,0l,0l,0l,6,-7,0,'\0','\001',0l,'i','\0' },
122-
{0l, {"anchor"},27l,0l,0l,0l,6,-8,0,'\0','\001',0l,'i','\0' },
123-
{0l, {"tmin"},20l,0l,0l,0l,4,-9,0,'\001','\001',0l,'i','\0' },
124-
{0l, {"tmax"},20l,0l,0l,0l,4,-10,0,'\001','\001',0l,'i','\0' },
125-
{0l, {"vtype"},18l,0l,0l,0l,1,-11,0,'\001','\001',0l,'c','\0' },
114+
{0l, {"ctid"},27l,0l,6,-1,0,-1,'\0','\0','i','\0','\0' },
115+
{0l, {"oid"},26l,0l,4,-2,0,-1,'\001','\0','i','\0','\0' },
116+
{0l, {"xmin"},28l,0l,4,-3,0,-1,'\0','\0','i','\0','\0' },
117+
{0l, {"cmin"},29l,0l,2,-4,0,-1,'\001','\0','s','\0','\0' },
118+
{0l, {"xmax"},28l,0l,4,-5,0,-1,'\0','\0','i','\0','\0' },
119+
{0l, {"cmax"},29l,0l,2,-6,0,-1,'\001','\0','s','\0','\0' },
120+
{0l, {"chain"},27l,0l,6,-7,0,-1,'\0','\0','i','\0','\0' },
121+
{0l, {"anchor"},27l,0l,6,-8,0,-1,'\0','\0','i','\0','\0' },
122+
{0l, {"tmin"},702l,0l,4,-9,0,-1,'\001','\0','i','\0','\0' },
123+
{0l, {"tmax"},702l,0l,4,-10,0,-1,'\001','\0','i','\0','\0' },
124+
{0l, {"vtype"},18l,0l,1,-11,0,-1,'\001','\0','c','\0','\0' },
126125
};
127126

128127
/* ----------------------------------------------------------------
@@ -308,7 +307,6 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
308307
funcTupDesc->attrs[0]->atttypid=retType;
309308
funcTupDesc->attrs[0]->attnum=1;
310309
funcTupDesc->attrs[0]->attbyval= ((TypeTupleForm)GETSTRUCT(tuple))->typbyval;
311-
funcTupDesc->attrs[0]->attcanindex=0;
312310

313311
/*
314312
* make the attributes name the same as the functions

‎src/backend/catalog/indexing.c

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.9 1997/01/10 20:16:47 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.10 1997/08/21 01:32:06 vadim Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -39,39 +39,9 @@
3939
*pg_type
4040
*pg_naming
4141
*pg_class
42+
*pg_attrdef
43+
*pg_relcheck
4244
*/
43-
/*
44-
static NameDataAttributeNameIndexData = { "pg_attnameind" };
45-
static NameDataAttributeNumIndexData = { "pg_attnumind" };
46-
static NameData AttributeRelidIndexData= { "pg_attrelidind" };
47-
static NameDataProcedureNameIndexData = { "pg_procnameind" };
48-
static NameDataProcedureOidIndexData = { "pg_procidind" };
49-
static NameDataProcedureSrcIndexData = { "pg_procsrcind" };
50-
static NameDataTypeNameIndexData = { "pg_typenameind" };
51-
static NameDataTypeOidIndexData = { "pg_typeidind" };
52-
static NameData ClassNameIndexData = { "pg_classnameind" };
53-
static NameData ClassOidIndexData = { "pg_classoidind" };
54-
55-
NameAttributeNameIndex = &AttributeNameIndexData;
56-
NameAttributeNumIndex = &AttributeNumIndexData;
57-
NameAttributeRelidIndex= &AttributeRelidIndexData;
58-
NameProcedureNameIndex = &ProcedureNameIndexData;
59-
NameProcedureOidIndex = &ProcedureOidIndexData;
60-
NameProcedureSrcIndex = &ProcedureSrcIndexData;
61-
NameTypeNameIndex = &TypeNameIndexData;
62-
NameTypeOidIndex = &TypeOidIndexData;
63-
NameClassNameIndex = &ClassNameIndexData;
64-
NameClassOidIndex = &ClassOidIndexData;
65-
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndexData.data,
66-
AttributeNumIndexData.data,
67-
AttributeRelidIndexData.data};
68-
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndexData.data,
69-
ProcedureOidIndexData.data,
70-
ProcedureSrcIndexData.data};char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndexData.data,
71-
TypeOidIndexData.data};
72-
char *Name_pg_class_indices[Num_pg_class_indices]= {ClassNameIndexData.data,
73-
ClassOidIndexData.data};
74-
*/
7545

7646
char*Name_pg_attr_indices[Num_pg_attr_indices]= {AttributeNameIndex,
7747
AttributeNumIndex,
@@ -83,6 +53,9 @@ char *Name_pg_type_indices[Num_pg_type_indices] = { TypeNameIndex,
8353
TypeOidIndex};
8454
char*Name_pg_class_indices[Num_pg_class_indices]= {ClassNameIndex,
8555
ClassOidIndex};
56+
char*Name_pg_attrdef_indices[Num_pg_attrdef_indices]= {AttrDefaultIndex };
57+
58+
char*Name_pg_relcheck_indices[Num_pg_relcheck_indices]= {RelCheckIndex };
8659

8760

8861
staticHeapTupleCatalogIndexFetchTuple(RelationheapRelation,

‎src/backend/commands/command.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.10 1997/08/19 04:43:27 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.11 1997/08/21 01:32:19 vadim Exp $
1111
*
1212
* NOTES
1313
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -382,12 +382,7 @@ PerformAddAttribute(char *relationName,
382382
(Datum)NULL);
383383

384384
attributeD.attrelid=reltup->t_oid;
385-
attributeD.attdefrel=InvalidOid;/* XXX temporary */
386385
attributeD.attnvals=0;/* XXX temporary */
387-
attributeD.atttyparg=InvalidOid;/* XXX temporary */
388-
attributeD.attbound=0;/* XXX temporary */
389-
attributeD.attcanindex=0;/* XXX need this info */
390-
attributeD.attproc=InvalidOid;/* XXX tempoirary */
391386
attributeD.attcacheoff=-1;
392387

393388
attributeTuple=heap_addheader(Natts_pg_attribute,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp