*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.7 1997/11/24 05:07:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.8 1997/11/28 04:39:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (DebugMode)
puts("creating bootstrap relation");
tupdesc = CreateTupleDesc(numattr,attrtypes);
- reldesc = heap_creatr(LexIDStr($3), tupdesc);
+ reldesc = heap_create(LexIDStr($3), tupdesc);
if (DebugMode)
puts("bootstrap relation created ok");
}
{
Oid id;
TupleDesc tupdesc;
- /* extern Oid heap_create();*/
+ /* extern Oid heap_create_and_catalog();*/
tupdesc = CreateTupleDesc(numattr,attrtypes);
- id = heap_create(LexIDStr($3), tupdesc);
+ id = heap_create_and_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.37 1997/11/26 04:50:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.38 1997/11/28 04:39:34 momjian Exp $
*
* INTERFACE ROUTINES
- * heap_creatr() - Create an uncataloged heap relation
- * heap_create() - Create a cataloged relation
+ * heap_create() - Create an uncataloged heap relation
+ * heap_create_and_catalog() - Create a cataloged relation
* heap_destroy() - Removes named relation from catalogs
*
* NOTES
* this code taken from access/heap/create.c, which contains
- * the old heap_creater, amcreate, and amdestroy. those routines
- * will soon call these routines using the function manager,
+ * the old heap_create_and_catalogr, amcreate, and amdestroy.
+ * those routines will soon call these routines using the function
+ * manager,
* just like the poorly named "NewXXX" routines do. The
* "New" routines are all going to die soon, once and for all!
* -cim 1/13/91
/* ----------------------------------------------------------------
- * heap_creatr - Create an uncataloged heap relation
+ * heap_create - Create an uncataloged heap relation
*
* Fields relpages, reltuples, reltuples, relkeys, relhistory,
* relisindexed, and relkind of rdesc->rd_rel are initialized
* into the transaction context block.
*
*
- * if heap_creatr is called with "" as the name, then heap_creatr will create a
- * temporary name "temp_$RELOID" for the relation
+ * if heap_create is called with "" as the name, then heap_create will create
+ * a temporary name "temp_$RELOID" for the relation
* ----------------------------------------------------------------
*/
Relation
-heap_creatr(char *name,
+heap_create(char *name,
TupleDesc tupDesc)
{
register unsigned i;
/* ----------------------------------------------------------------
- * heap_create - Create a cataloged relation
+ * heap_create_and_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_creater() is called to create the new relation on
- * disk.
+ * 3) heap_create_and_catalogr() is called to create the new relation
+ * on disk.
*
* 4) TypeDefine() is called to define a new type corresponding
* to the new relation.
* create new relation
* insert new relation into attribute catalog
*
- * Should coordinate with heap_creater(). Either it should
- * not be called or there should be a way to prevent
+ * Should coordinate with heap_create_and_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).
* Also, if the transaction does not commit, then the
}
/* --------------------------------
- * heap_create
+ * heap_create_and_catalog
*
* creates a new cataloged relation. see comments above.
* --------------------------------
*/
Oid
-heap_create(char relname[],
- TupleDesc tupdesc)
+heap_create_and_catalog(char relname[],
+ TupleDesc tupdesc)
{
Relation pg_class_desc;
Relation new_rel_desc;
* create an uncataloged relation and pull its relation oid
* from the newly formed relation descriptor.
*
- * Note: The call to heap_creatr() does all the "real" work
+ * Note: The call to heap_create() does all the "real" work
* of creating the disk file for the relation.
* ----------------
*/
- new_rel_desc = heap_creatr(relname, tupdesc);
+ new_rel_desc = heap_create(relname, tupdesc);
new_rel_oid = new_rel_desc->rd_att->attrs[0]->attrelid;
/* ----------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.30 1997/11/25 21:58:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.31 1997/11/28 04:39:38 momjian Exp $
*
*
* INTERFACE ROUTINES
* create the index relation
* ----------------
*/
- indexRelation = heap_creatr(indexRelationName,
+ indexRelation = heap_create(indexRelationName,
indexTupDesc);
/* ----------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.17 1997/11/21 18:09:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.18 1997/11/28 04:39:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
OldHeapDesc = RelationGetTupleDescriptor(OldHeap);
/*
- * Need to make a copy of the tuple descriptor, heap_create modifies
- * it.
+ * Need to make a copy of the tuple descriptor, heap_create_and_catalog
+ * modifies it.
*/
tupdesc = CreateTupleDescCopy(OldHeapDesc);
- OIDNewHeap = heap_create(NewName, tupdesc);
+ OIDNewHeap = heap_create_and_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.19 1997/11/21 18:09:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.20 1997/11/28 04:39:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
}
- relationId = heap_create(relname, descriptor);
+ relationId = heap_create_and_catalog(relname, descriptor);
StoreCatalogInheritance(relationId, inheritList);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.13 1997/11/25 21:59:00 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.14 1997/11/28 04:39:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
len = length(q->qtrees[0]->targetList);
tupdesc = rel->rd_att;
- relid = heap_create(child->nodeElem->outTypes->val[0], tupdesc);
+ relid = heap_create_and_catalog(
+ child->nodeElem->outTypes->val[0], tupdesc);
}
else
{
}
else
{
- relid = heap_create(child->nodeElem->outTypes->val[0],
- tupdesc);
+ relid = heap_create_and_catalog(
+ child->nodeElem->outTypes->val[0], tupdesc);
}
}
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.11 1997/11/27 02:23:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.12 1997/11/28 04:40:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
/*
- * heap_creatr creates a name if the argument to heap_creatr is
+ * heap_create creates a name if the argument to heap_create is
* '\0 '
*/
- relDesc = heap_creatr("", tupType);
+ relDesc = heap_create("", tupType);
}
else
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.33 1997/11/24 05:08:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.34 1997/11/28 04:40:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* fixup to prevent zero-length columns in create */
setVarAttrLenForCreateTable(tupdesc, targetList, rangeTable);
- intoRelationId = heap_create(intoName, tupdesc);
+ intoRelationId = heap_create_and_catalog(intoName, tupdesc);
#ifdef NOT_USED /* it's copy ... */
resetVarAttrLenForCreateTable(tupdesc);
#endif
* ExecEndTee
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.11 1997/11/21 18:10:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.12 1997/11/28 04:40:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (RelationIsValid(r))
bufferRel = heap_openr(teeState->tee_bufferRelname);
else
- bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
- tupType));
+ bufferRel = heap_open(
+ heap_create_and_catalog(teeState->tee_bufferRelname, tupType));
}
else
{
"ttemp_%d", /* 'ttemp' for 'tee' temporary */
newoid());
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
- bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
- tupType));
+ bufferRel = heap_open(
+ heap_create_and_catalog(teeState->tee_bufferRelname, tupType));
}
teeState->tee_bufferRel = bufferRel;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.22 1997/11/21 19:02:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.23 1997/11/28 04:40:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* be located on whatever storage manager the user requested.
*/
- heap_create(objname, tupdesc);
+ heap_create_and_catalog(objname, tupdesc);
/* make the relation visible in this transaction */
CommandCounterIncrement();
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: heap.h,v 1.8 1997/11/21 18:11:56 momjian Exp $
+ * $Id: heap.h,v 1.9 1997/11/28 04:40:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <utils/rel.h>
-extern Relation heap_creatr(char *relname, TupleDesc att);
+extern Relation heap_create(char *relname, TupleDesc att);
extern Oid
-heap_create(char relname[], TupleDesc tupdesc);
+heap_create_and_catalog(char relname[], TupleDesc tupdesc);
extern void heap_destroy(char relname[]);
extern void heap_destroyr(Relation r);