Rename heap_destroyr to heap_destroy, heap_destroy to heap_destroy_with_catalog.
This commit is contained in:
parent
c445ba331b
commit
002796b5ca
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.8 1997/11/28 04:39:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.9 1997/11/28 17:26:43 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -178,10 +178,10 @@ CreateStmt:
|
||||
{
|
||||
Oid id;
|
||||
TupleDesc tupdesc;
|
||||
/* extern Oid heap_create_and_catalog();*/
|
||||
/* extern Oid heap_create_with_catalog();*/
|
||||
|
||||
tupdesc = CreateTupleDesc(numattr,attrtypes);
|
||||
id = heap_create_and_catalog(LexIDStr($3), tupdesc);
|
||||
id = heap_create_with_catalog(LexIDStr($3), tupdesc);
|
||||
if (!Quiet)
|
||||
printf("CREATED relation %s with OID %d\n",
|
||||
LexIDStr($3), id);
|
||||
|
@ -7,16 +7,16 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.38 1997/11/28 04:39:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.39 1997/11/28 17:26:51 momjian Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* heap_create() - Create an uncataloged heap relation
|
||||
* heap_create_and_catalog() - Create a cataloged relation
|
||||
* heap_destroy() - Removes named relation from catalogs
|
||||
* heap_create_with_catalog() - Create a cataloged relation
|
||||
* heap_destroy_with_catalog() - Removes named relation from catalogs
|
||||
*
|
||||
* NOTES
|
||||
* this code taken from access/heap/create.c, which contains
|
||||
* the old heap_create_and_catalogr, amcreate, and amdestroy.
|
||||
* the old heap_create_with_catalogr, amcreate, and amdestroy.
|
||||
* those routines will soon call these routines using the function
|
||||
* manager,
|
||||
* just like the poorly named "NewXXX" routines do. The
|
||||
@ -332,7 +332,7 @@ heap_create(char *name,
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* heap_create_and_catalog - Create a cataloged relation
|
||||
* heap_create_with_catalog - Create a cataloged relation
|
||||
*
|
||||
* this is done in 6 steps:
|
||||
*
|
||||
@ -343,7 +343,7 @@ heap_create(char *name,
|
||||
* preforms a scan to ensure that no relation with the
|
||||
* same name already exists.
|
||||
*
|
||||
* 3) heap_create_and_catalogr() is called to create the new relation
|
||||
* 3) heap_create_with_catalogr() is called to create the new relation
|
||||
* on disk.
|
||||
*
|
||||
* 4) TypeDefine() is called to define a new type corresponding
|
||||
@ -376,7 +376,7 @@ heap_create(char *name,
|
||||
* create new relation
|
||||
* insert new relation into attribute catalog
|
||||
*
|
||||
* Should coordinate with heap_create_and_catalogr(). Either
|
||||
* Should coordinate with heap_create_with_catalogr(). Either
|
||||
* it should not be called or there should be a way to prevent
|
||||
* the relation from being removed at the end of the
|
||||
* transaction if it is successful ('u'/'r' may be enough).
|
||||
@ -739,13 +739,13 @@ addNewRelationType(char *typeName, Oid new_rel_oid)
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
* heap_create_and_catalog
|
||||
* heap_create_with_catalog
|
||||
*
|
||||
* creates a new cataloged relation. see comments above.
|
||||
* --------------------------------
|
||||
*/
|
||||
Oid
|
||||
heap_create_and_catalog(char relname[],
|
||||
heap_create_with_catalog(char relname[],
|
||||
TupleDesc tupdesc)
|
||||
{
|
||||
Relation pg_class_desc;
|
||||
@ -830,7 +830,7 @@ heap_create_and_catalog(char relname[],
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* heap_destroy - removes all record of named relation from catalogs
|
||||
* heap_destroy_with_catalog - removes all record of named relation from catalogs
|
||||
*
|
||||
* 1) open relation, check for existence, etc.
|
||||
* 2) remove inheritance information
|
||||
@ -1246,12 +1246,12 @@ DeletePgTypeTuple(Relation rdesc)
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
* heap_destroy
|
||||
* heap_destroy_with_catalog
|
||||
*
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
heap_destroy(char *relname)
|
||||
heap_destroy_with_catalog(char *relname)
|
||||
{
|
||||
Relation rdesc;
|
||||
Oid rid;
|
||||
@ -1358,13 +1358,13 @@ heap_destroy(char *relname)
|
||||
}
|
||||
|
||||
/*
|
||||
* heap_destroyr
|
||||
* heap_destroy
|
||||
* destroy and close temporary relations
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
heap_destroyr(Relation rdesc)
|
||||
heap_destroy(Relation rdesc)
|
||||
{
|
||||
ReleaseRelationBuffers(rdesc);
|
||||
if (!(rdesc->rd_istemp) || !(rdesc->rd_tmpunlinked))
|
||||
@ -1475,7 +1475,7 @@ DestroyTempRels(void)
|
||||
rdesc = tempRels->rels[i];
|
||||
/* rdesc may be NULL if it has been removed from the list already */
|
||||
if (rdesc)
|
||||
heap_destroyr(rdesc);
|
||||
heap_destroy(rdesc);
|
||||
}
|
||||
free(tempRels->rels);
|
||||
free(tempRels);
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.18 1997/11/28 04:39:43 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.19 1997/11/28 17:26:55 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -175,7 +175,7 @@ cluster(char oldrelname[], char oldindexname[])
|
||||
|
||||
|
||||
/* Destroy old heap (along with its index) and rename new. */
|
||||
heap_destroy(oldrelname);
|
||||
heap_destroy_with_catalog(oldrelname);
|
||||
|
||||
renamerel(NewHeapName, saveoldrelname);
|
||||
TypeRename(NewHeapName, saveoldrelname);
|
||||
@ -209,13 +209,13 @@ copy_heap(Oid OIDOldHeap)
|
||||
OldHeapDesc = RelationGetTupleDescriptor(OldHeap);
|
||||
|
||||
/*
|
||||
* Need to make a copy of the tuple descriptor, heap_create_and_catalog
|
||||
* Need to make a copy of the tuple descriptor, heap_create_with_catalog
|
||||
* modifies it.
|
||||
*/
|
||||
|
||||
tupdesc = CreateTupleDescCopy(OldHeapDesc);
|
||||
|
||||
OIDNewHeap = heap_create_and_catalog(NewName, tupdesc);
|
||||
OIDNewHeap = heap_create_with_catalog(NewName, tupdesc);
|
||||
|
||||
if (!OidIsValid(OIDNewHeap))
|
||||
elog(WARN, "clusterheap: cannot create temporary heap relation\n");
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.20 1997/11/28 04:39:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.21 1997/11/28 17:27:04 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -137,7 +137,7 @@ DefineRelation(CreateStmt *stmt)
|
||||
}
|
||||
}
|
||||
|
||||
relationId = heap_create_and_catalog(relname, descriptor);
|
||||
relationId = heap_create_with_catalog(relname, descriptor);
|
||||
|
||||
StoreCatalogInheritance(relationId, inheritList);
|
||||
}
|
||||
@ -157,7 +157,7 @@ void
|
||||
RemoveRelation(char *name)
|
||||
{
|
||||
AssertArg(name);
|
||||
heap_destroy(name);
|
||||
heap_destroy_with_catalog(name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.14 1997/11/28 04:39:53 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.15 1997/11/28 17:27:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1047,7 +1047,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
len = length(q->qtrees[0]->targetList);
|
||||
tupdesc = rel->rd_att;
|
||||
|
||||
relid = heap_create_and_catalog(
|
||||
relid = heap_create_with_catalog(
|
||||
child->nodeElem->outTypes->val[0], tupdesc);
|
||||
}
|
||||
else
|
||||
@ -1072,7 +1072,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
}
|
||||
else
|
||||
{
|
||||
relid = heap_create_and_catalog(
|
||||
relid = heap_create_with_catalog(
|
||||
child->nodeElem->outTypes->val[0], tupdesc);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.17 1997/11/25 21:59:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.18 1997/11/28 17:27:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -241,7 +241,7 @@ AttributeAndRelationRemove(Oid typeOid)
|
||||
char *name;
|
||||
|
||||
name = (((Form_pg_class) GETSTRUCT(tup))->relname).data;
|
||||
heap_destroy(name);
|
||||
heap_destroy_with_catalog(name);
|
||||
}
|
||||
}
|
||||
heap_endscan(sdesc);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.16 1997/11/25 21:59:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.17 1997/11/28 17:27:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -314,6 +314,6 @@ RemoveView(char *viewName)
|
||||
/*
|
||||
* now remove the relation.
|
||||
*/
|
||||
heap_destroy(viewName);
|
||||
heap_destroy_with_catalog(viewName);
|
||||
pfree(rname);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.34 1997/11/28 04:40:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.35 1997/11/28 17:27:20 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -572,7 +572,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
|
||||
/* fixup to prevent zero-length columns in create */
|
||||
setVarAttrLenForCreateTable(tupdesc, targetList, rangeTable);
|
||||
|
||||
intoRelationId = heap_create_and_catalog(intoName, tupdesc);
|
||||
intoRelationId = heap_create_with_catalog(intoName, tupdesc);
|
||||
#ifdef NOT_USED /* it's copy ... */
|
||||
resetVarAttrLenForCreateTable(tupdesc);
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.10 1997/11/20 23:21:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.11 1997/11/28 17:27:25 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -319,7 +319,7 @@ ExecEndMaterial(Material *node)
|
||||
matstate = node->matstate;
|
||||
tempRelation = matstate->mat_TempRelation;
|
||||
|
||||
heap_destroyr(tempRelation);
|
||||
heap_destroy(tempRelation);
|
||||
|
||||
/* ----------------
|
||||
* close the temp relation and shut down the scan.
|
||||
|
@ -15,7 +15,7 @@
|
||||
* ExecEndTee
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.12 1997/11/28 04:40:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.13 1997/11/28 17:27:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -168,7 +168,7 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
||||
bufferRel = heap_openr(teeState->tee_bufferRelname);
|
||||
else
|
||||
bufferRel = heap_open(
|
||||
heap_create_and_catalog(teeState->tee_bufferRelname, tupType));
|
||||
heap_create_with_catalog(teeState->tee_bufferRelname, tupType));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -177,7 +177,7 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
||||
newoid());
|
||||
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
|
||||
bufferRel = heap_open(
|
||||
heap_create_and_catalog(teeState->tee_bufferRelname, tupType));
|
||||
heap_create_with_catalog(teeState->tee_bufferRelname, tupType));
|
||||
}
|
||||
|
||||
teeState->tee_bufferRel = bufferRel;
|
||||
@ -519,7 +519,7 @@ ExecEndTee(Tee *node, Plan *parent)
|
||||
bufferRel = teeState->tee_bufferRel;
|
||||
if (bufferRel)
|
||||
{
|
||||
heap_destroyr(bufferRel);
|
||||
heap_destroy(bufferRel);
|
||||
teeState->tee_bufferRel = NULL;
|
||||
if (teeState->tee_mcxt)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.23 1997/11/28 04:40:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.24 1997/11/28 17:27:50 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -139,7 +139,7 @@ inv_create(int flags)
|
||||
* be located on whatever storage manager the user requested.
|
||||
*/
|
||||
|
||||
heap_create_and_catalog(objname, tupdesc);
|
||||
heap_create_with_catalog(objname, tupdesc);
|
||||
|
||||
/* make the relation visible in this transaction */
|
||||
CommandCounterIncrement();
|
||||
@ -283,7 +283,7 @@ inv_destroy(Oid lobjId)
|
||||
if (!RelationIsValid(r) || r->rd_rel->relkind == RELKIND_INDEX)
|
||||
return -1;
|
||||
|
||||
heap_destroy(r->rd_rel->relname.data);
|
||||
heap_destroy_with_catalog(r->rd_rel->relname.data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: heap.h,v 1.9 1997/11/28 04:40:40 momjian Exp $
|
||||
* $Id: heap.h,v 1.10 1997/11/28 17:28:02 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -18,10 +18,10 @@
|
||||
extern Relation heap_create(char *relname, TupleDesc att);
|
||||
|
||||
extern Oid
|
||||
heap_create_and_catalog(char relname[], TupleDesc tupdesc);
|
||||
heap_create_with_catalog(char relname[], TupleDesc tupdesc);
|
||||
|
||||
extern void heap_destroy(char relname[]);
|
||||
extern void heap_destroyr(Relation r);
|
||||
extern void heap_destroy_with_catalog(char relname[]);
|
||||
extern void heap_destroy(Relation r);
|
||||
|
||||
extern void InitTempRelList(void);
|
||||
extern void DestroyTempRels(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user