*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
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);
*
*
* 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
/* ----------------------------------------------------------------
- * heap_create_and_catalog - Create a cataloged relation
+ * heap_create_with_catalog - Create a cataloged relation
*
* this is done in 6 steps:
*
* 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
* 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).
}
/* --------------------------------
- * 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;
/* ----------------------------------------------------------------
- * 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
}
/* --------------------------------
- * heap_destroy
+ * heap_destroy_with_catalog
*
* --------------------------------
*/
void
-heap_destroy(char *relname)
+heap_destroy_with_catalog(char *relname)
{
Relation rdesc;
Oid rid;
}
/*
- * 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))
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* Destroy old heap (along with its index) and rename new. */
- heap_destroy(oldrelname);
+ heap_destroy_with_catalog(oldrelname);
renamerel(NewHeapName, saveoldrelname);
TypeRename(NewHeapName, saveoldrelname);
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");
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
}
- relationId = heap_create_and_catalog(relname, descriptor);
+ relationId = heap_create_with_catalog(relname, descriptor);
StoreCatalogInheritance(relationId, inheritList);
}
RemoveRelation(char *name)
{
AssertArg(name);
- heap_destroy(name);
+ heap_destroy_with_catalog(name);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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
}
else
{
- relid = heap_create_and_catalog(
+ relid = heap_create_with_catalog(
child->nodeElem->outTypes->val[0], tupdesc);
}
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
char *name;
name = (((Form_pg_class) GETSTRUCT(tup))->relname).data;
- heap_destroy(name);
+ heap_destroy_with_catalog(name);
}
}
heap_endscan(sdesc);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/*
* now remove the relation.
*/
- heap_destroy(viewName);
+ heap_destroy_with_catalog(viewName);
pfree(rname);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* 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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
matstate = node->matstate;
tempRelation = matstate->mat_TempRelation;
- heap_destroyr(tempRelation);
+ heap_destroy(tempRelation);
/* ----------------
* close the temp relation and shut down the scan.
* 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 $
*
*-------------------------------------------------------------------------
*/
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
{
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;
bufferRel = teeState->tee_bufferRel;
if (bufferRel)
{
- heap_destroyr(bufferRel);
+ heap_destroy(bufferRel);
teeState->tee_bufferRel = NULL;
if (teeState->tee_mcxt)
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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();
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;
}
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);