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

Commitaf5fde7

Browse files
committed
Make large objects their own relkind type. Fix dups in pg_class_mb
files. Fix sequence creation hack for relkind type.
1 parent8962ec4 commitaf5fde7

File tree

23 files changed

+2723
-3506
lines changed

23 files changed

+2723
-3506
lines changed

‎src/backend/bootstrap/bootparse.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.18 1998/07/26 04:30:18 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.19 1998/08/06 05:12:16 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -177,10 +177,10 @@ Boot_CreateStmt:
177177
{
178178
Oid id;
179179
TupleDesc tupdesc;
180-
/* extern Oid heap_create_with_catalog();*/
181180

182181
tupdesc = CreateTupleDesc(numattr,attrtypes);
183-
id = heap_create_with_catalog(LexIDStr($3), tupdesc);
182+
id = heap_create_with_catalog(LexIDStr($3),
183+
tupdesc, RELKIND_RELATION);
184184
if (!Quiet)
185185
printf("CREATED relation %s with OID %d\n",
186186
LexIDStr($3), id);

‎src/backend/catalog/heap.c

Lines changed: 14 additions & 15 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.55 1998/07/27 19:37:46 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.56 1998/08/06 05:12:19 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
*heap_create()- Create an uncataloged heap relation
@@ -16,7 +16,7 @@
1616
*
1717
* NOTES
1818
* this code taken from access/heap/create.c, which contains
19-
* the oldheap_create_with_catalogr, amcreate, and amdestroy.
19+
* the oldheap_create_with_catalog, amcreate, and amdestroy.
2020
* those routines will soon call these routines using the function
2121
* manager,
2222
* just like the poorly named "NewXXX" routines do.The
@@ -65,7 +65,8 @@
6565

6666
staticvoid
6767
AddPgRelationTuple(Relationpg_class_desc,
68-
Relationnew_rel_desc,Oidnew_rel_oid,unsignednatts);
68+
Relationnew_rel_desc,Oidnew_rel_oid,unsignednatts,
69+
charrelkind);
6970
staticvoidAddToTempRelList(Relationr);
7071
staticvoidDeletePgAttributeTuples(Relationrdesc);
7172
staticvoidDeletePgRelationTuple(Relationrdesc);
@@ -345,7 +346,7 @@ heap_create(char *name,
345346
* preforms a scan to ensure that no relation with the
346347
* same name already exists.
347348
*
348-
*3)heap_create_with_catalogr() is called to create the new relation
349+
*3)heap_create_with_catalog() is called to create the new relation
349350
* on disk.
350351
*
351352
*4) TypeDefine() is called to define a new type corresponding
@@ -378,7 +379,7 @@ heap_create(char *name,
378379
*create new relation
379380
*insert new relation into attribute catalog
380381
*
381-
*Should coordinate withheap_create_with_catalogr(). Either
382+
*Should coordinate withheap_create_with_catalog(). Either
382383
*it should not be called or there should be a way to prevent
383384
*the relation from being removed at the end of the
384385
*transaction if it is successful ('u'/'r' may be enough).
@@ -633,14 +634,13 @@ static void
633634
AddPgRelationTuple(Relationpg_class_desc,
634635
Relationnew_rel_desc,
635636
Oidnew_rel_oid,
636-
unsignednatts)
637+
unsignednatts,
638+
charrelkind)
637639
{
638640
Form_pg_classnew_rel_reltup;
639641
HeapTupletup;
640642
Relationidescs[Num_pg_class_indices];
641643
boolisBootstrap;
642-
externboolItsSequenceCreation;/* It's hack, I know... - vadim
643-
* 03/28/97*/
644644

645645
/* ----------------
646646
*first we munge some of the information in our
@@ -653,10 +653,7 @@ AddPgRelationTuple(Relation pg_class_desc,
653653
/* new_rel_reltup->reltuples = 1; *//* XXX */
654654

655655
new_rel_reltup->relowner=GetUserId();
656-
if (ItsSequenceCreation)
657-
new_rel_reltup->relkind=RELKIND_SEQUENCE;
658-
else
659-
new_rel_reltup->relkind=RELKIND_RELATION;
656+
new_rel_reltup->relkind=relkind;
660657
new_rel_reltup->relnatts=natts;
661658

662659
/* ----------------
@@ -747,8 +744,9 @@ addNewRelationType(char *typeName, Oid new_rel_oid)
747744
* --------------------------------
748745
*/
749746
Oid
750-
heap_create_with_catalog(charrelname[],
751-
TupleDesctupdesc)
747+
heap_create_with_catalog(char*relname,
748+
TupleDesctupdesc,
749+
charrelkind)
752750
{
753751
Relationpg_class_desc;
754752
Relationnew_rel_desc;
@@ -813,7 +811,8 @@ heap_create_with_catalog(char relname[],
813811
AddPgRelationTuple(pg_class_desc,
814812
new_rel_desc,
815813
new_rel_oid,
816-
natts);
814+
natts,
815+
relkind);
817816

818817
StoreConstraints(new_rel_desc);
819818

‎src/backend/commands/cluster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.26 1998/07/27 19:37:50 vadim Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.27 1998/08/06 05:12:22 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -218,7 +218,7 @@ copy_heap(Oid OIDOldHeap)
218218

219219
tupdesc=CreateTupleDescCopy(OldHeapDesc);
220220

221-
OIDNewHeap=heap_create_with_catalog(NewName,tupdesc);
221+
OIDNewHeap=heap_create_with_catalog(NewName,tupdesc,RELKIND_RELATION);
222222

223223
if (!OidIsValid(OIDNewHeap))
224224
elog(ERROR,"clusterheap: cannot create temporary heap relation\n");

‎src/backend/commands/creatinh.c

Lines changed: 4 additions & 3 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/creatinh.c,v 1.30 1998/06/15 19:28:14 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.31 1998/08/06 05:12:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -45,7 +45,7 @@ static void StoreCatalogInheritance(Oid relationId, List *supers);
4545
* ----------------------------------------------------------------
4646
*/
4747
void
48-
DefineRelation(CreateStmt*stmt)
48+
DefineRelation(CreateStmt*stmt,charrelkind)
4949
{
5050
char*relname=palloc(NAMEDATALEN);
5151
List*schema=stmt->tableElts;
@@ -137,7 +137,8 @@ DefineRelation(CreateStmt *stmt)
137137
}
138138
}
139139

140-
relationId=heap_create_with_catalog(relname,descriptor);
140+
relationId=heap_create_with_catalog(relname,
141+
descriptor,relkind);
141142

142143
StoreCatalogInheritance(relationId,inheritList);
143144
}

‎src/backend/commands/recipe.c

Lines changed: 5 additions & 3 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/recipe.c,v 1.21 1998/06/15 19:28:15 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.22 1998/08/06 05:12:26 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1032,7 +1032,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
10321032
tupdesc=rel->rd_att;
10331033

10341034
relid=heap_create_with_catalog(
1035-
child->nodeElem->outTypes->val[0],tupdesc);
1035+
child->nodeElem->outTypes->val[0],
1036+
tupdesc,RELKIND_RELATION);
10361037
}
10371038
else
10381039
{
@@ -1055,7 +1056,8 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
10551056
else
10561057
{
10571058
relid=heap_create_with_catalog(
1058-
child->nodeElem->outTypes->val[0],tupdesc);
1059+
child->nodeElem->outTypes->val[0],
1060+
tupdesc,RELKIND_RELATION);
10591061
}
10601062
}
10611063
}

‎src/backend/commands/sequence.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#defineSEQ_MAXVALUE((int4)0x7FFFFFFF)
2525
#defineSEQ_MINVALUE-(SEQ_MAXVALUE)
2626

27-
boolItsSequenceCreation= false;
28-
2927
typedefstructFormData_pg_sequence
3028
{
3129
NameDatasequence_name;
@@ -157,15 +155,7 @@ DefineSequence(CreateSeqStmt *seq)
157155
stmt->inhRelnames=NIL;
158156
stmt->constraints=NIL;
159157

160-
ItsSequenceCreation= true;/* hack */
161-
162-
DefineRelation(stmt);
163-
164-
/*
165-
* Xact abort calls CloseSequences, which turns ItsSequenceCreation
166-
* off
167-
*/
168-
ItsSequenceCreation= false;/* hack */
158+
DefineRelation(stmt,RELKIND_SEQUENCE);
169159

170160
rel=heap_openr(seq->seqname);
171161
Assert(RelationIsValid(rel));
@@ -438,8 +428,6 @@ CloseSequences(void)
438428
SeqTableelm;
439429
Relationrel;
440430

441-
ItsSequenceCreation= false;
442-
443431
for (elm=seqtab;elm!= (SeqTable)NULL;)
444432
{
445433
if (elm->rel!= (Relation)NULL)/* opened in current xact */

‎src/backend/commands/view.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.23 1998/07/19 05:49:12 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.24 1998/08/06 05:12:30 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -105,7 +105,7 @@ DefineVirtualRelation(char *relname, List *tlist)
105105
/*
106106
* finally create the relation...
107107
*/
108-
DefineRelation(&createStmt);
108+
DefineRelation(&createStmt,RELKIND_RELATION);
109109
}
110110

111111
/*------------------------------------------------------------------

‎src/backend/executor/execMain.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.51 1998/07/27 19:37:55 vadim Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.52 1998/08/06 05:12:33 momjian Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -587,7 +587,8 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
587587
*/
588588
tupdesc=CreateTupleDescCopy(tupType);
589589

590-
intoRelationId=heap_create_with_catalog(intoName,tupdesc);
590+
intoRelationId=heap_create_with_catalog(intoName,
591+
tupdesc,RELKIND_RELATION);
591592

592593
FreeTupleDesc(tupdesc);
593594

‎src/backend/executor/nodeTee.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*ExecEndTee
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.19 1998/07/27 19:37:57 vadim Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.20 1998/08/06 05:12:36 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -168,7 +168,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
168168
bufferRel=heap_openr(teeState->tee_bufferRelname);
169169
else
170170
bufferRel=heap_open(
171-
heap_create_with_catalog(teeState->tee_bufferRelname,tupType));
171+
heap_create_with_catalog(teeState->tee_bufferRelname,
172+
tupType,RELKIND_RELATION));
172173
}
173174
else
174175
{
@@ -177,7 +178,8 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
177178
newoid());
178179
/*bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
179180
bufferRel=heap_open(
180-
heap_create_with_catalog(teeState->tee_bufferRelname,tupType));
181+
heap_create_with_catalog(teeState->tee_bufferRelname,
182+
tupType,RELKIND_RELATION));
181183
}
182184

183185
teeState->tee_bufferRel=bufferRel;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp