*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.59 1999/11/23 20:06:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.60 1999/11/24 00:44:28 momjian Exp $
*
*
* INTERFACE ROUTINES
* heap_fetch - retrive tuple with tid
* heap_insert - insert tuple into a relation
* heap_delete - delete a tuple from a relation
- * heap_replace - replace a tuple in a relation with another tuple
+ * heap_update - replace a tuple in a relation with another tuple
* heap_markpos - mark scan position
* heap_restrpos - restore position to marked location
*
}
/*
- * heap_replace - replace a tuple
+ * heap_update - replace a tuple
*/
int
-heap_replace(Relation relation, ItemPointer otid, HeapTuple newtup,
+heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
ItemPointer ctid)
{
ItemId lp;
{
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
ReleaseBuffer(buffer);
- elog(ERROR, "heap_replace: (am)invalid tid");
+ elog(ERROR, "heap_update: (am)invalid tid");
}
else if (result == HeapTupleBeingUpdated)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.30 1999/11/22 17:55:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.31 1999/11/24 00:44:28 momjian Exp $
*
* NOTES
* See acl.h.
* Find the pg_class tuple matching 'relname' and extract the ACL. If
* there's no ACL, create a default using the pg_class.relowner field.
*
- * We can't use the syscache here, since we need to do a heap_replace on
+ * We can't use the syscache here, since we need to do a heap_update on
* the tuple we find.
*/
relation = heap_openr(RelationRelationName, RowExclusiveLock);
tuple = heap_modifytuple(tuple, relation, values, nulls, replaces);
/* XXX handle index on pg_class? */
setheapoverride(true);
- heap_replace(relation, &tuple->t_self, tuple, NULL);
+ heap_update(relation, &tuple->t_self, tuple, NULL);
setheapoverride(false);
/* keep the catalog indices up to date */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.109 1999/11/22 17:55:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.110 1999/11/24 00:44:29 momjian Exp $
*
*
* INTERFACE ROUTINES
if (! attStruct->atthasdef)
{
attStruct->atthasdef = true;
- heap_replace(attrrel, &atttup->t_self, atttup, NULL);
+ heap_update(attrrel, &atttup->t_self, atttup, NULL);
/* keep catalog indices current */
CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices,
attridescs);
relStruct->relchecks = numchecks;
- heap_replace(relrel, &reltup->t_self, reltup, NULL);
+ heap_update(relrel, &reltup->t_self, reltup, NULL);
/* keep catalog indices current */
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.97 1999/11/22 17:55:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.98 1999/11/24 00:44:29 momjian Exp $
*
*
* INTERFACE ROUTINES
newtup = heap_modifytuple(tuple, pg_index, values, nulls, replace);
- heap_replace(pg_index, &newtup->t_self, newtup, NULL);
+ heap_update(pg_index, &newtup->t_self, newtup, NULL);
pfree(newtup);
heap_close(pg_index, RowExclusiveLock);
values[Anum_pg_class_relhasindex - 1] = CharGetDatum(hasindex);
newtup = heap_modifytuple(tuple, pg_class, values, nulls, replace);
- heap_replace(pg_class, &tuple->t_self, newtup, NULL);
+ heap_update(pg_class, &tuple->t_self, newtup, NULL);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);
CatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, newtup);
CatalogCloseIndices(Num_pg_class_indices, idescs);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.43 1999/11/22 17:55:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.44 1999/11/24 00:44:29 momjian Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
replaces);
setheapoverride(true);
- heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
+ heap_update(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
}
else
replaces);
setheapoverride(true);
- heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
+ heap_update(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
replaces);
setheapoverride(true);
- heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
+ heap_update(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
replaces);
setheapoverride(true);
- heap_replace(pg_operator_desc, &tup->t_self, tup, NULL);
+ heap_update(pg_operator_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
if (RelationGetForm(pg_operator_desc)->relhasindex)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.42 1999/11/22 17:55:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.43 1999/11/24 00:44:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
replaces);
setheapoverride(true);
- heap_replace(pg_type_desc, &tup->t_self, tup, NULL);
+ heap_update(pg_type_desc, &tup->t_self, tup, NULL);
setheapoverride(false);
typeObjectId = tup->t_data->t_oid;
namestrcpy(&(((Form_pg_type) GETSTRUCT(oldtup))->typname), newTypeName);
setheapoverride(true);
- heap_replace(pg_type_desc, &oldtup->t_self, oldtup, NULL);
+ heap_update(pg_type_desc, &oldtup->t_self, oldtup, NULL);
setheapoverride(false);
/* update the system catalog indices */
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.55 1999/11/22 17:55:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.56 1999/11/24 00:44:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
rTuple = heap_modifytuple(lTuple, lRel,
value, nulls, repl);
- heap_replace(lRel, &lTuple->t_self, rTuple, NULL);
+ heap_update(lRel, &lTuple->t_self, rTuple, NULL);
if (RelationGetForm(lRel)->relhasindex)
{
Relation idescs[Num_pg_listener_indices];
NotifyMyFrontEnd(relname, sourcePID);
/* Rewrite the tuple with 0 in notification column */
rTuple = heap_modifytuple(lTuple, lRel, value, nulls, repl);
- heap_replace(lRel, &lTuple->t_self, rTuple, NULL);
+ heap_update(lRel, &lTuple->t_self, rTuple, NULL);
if (RelationGetForm(lRel)->relhasindex)
{
Relation idescs[Num_pg_listener_indices];
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.57 1999/11/22 17:56:00 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.58 1999/11/24 00:44:30 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
heap_close(attrdesc, RowExclusiveLock);
((Form_pg_class) GETSTRUCT(reltup))->relnatts = maxatts;
- heap_replace(rel, &reltup->t_self, reltup, NULL);
+ heap_update(rel, &reltup->t_self, reltup, NULL);
/* keep catalog indices current */
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
if (HeapTupleIsValid(searchtuple)) {
- /*** If the comment is blank, call heap_delete, else heap_replace ***/
+ /*** If the comment is blank, call heap_delete, else heap_update ***/
if ((comment == NULL) || (strlen(comment) == 0)) {
heap_delete(description, &searchtuple->t_self, NULL);
desctuple = heap_modifytuple(searchtuple, description, values,
nulls, replaces);
setheapoverride(true);
- heap_replace(description, &searchtuple->t_self, desctuple, NULL);
+ heap_update(description, &searchtuple->t_self, desctuple, NULL);
setheapoverride(false);
modified = TRUE;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.35 1999/11/07 23:08:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.36 1999/11/24 00:44:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
StrNCpy(NameStr(((Form_pg_attribute) GETSTRUCT(oldatttup))->attname),
newattname, NAMEDATALEN);
- heap_replace(attrelation, &oldatttup->t_self, oldatttup, NULL);
+ heap_update(attrelation, &oldatttup->t_self, oldatttup, NULL);
/* keep system catalog indices current */
CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices, irelations);
StrNCpy(NameStr(((Form_pg_class) GETSTRUCT(oldreltup))->relname),
newrelname, NAMEDATALEN);
- heap_replace(relrelation, &oldreltup->t_self, oldreltup, NULL);
+ heap_update(relrelation, &oldreltup->t_self, oldreltup, NULL);
/* keep the system catalog indices current */
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, irelations);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found + 1;
RelationInvalidateHeapTuple(pgrel, tuple);
- heap_replace(pgrel, &tuple->t_self, tuple, NULL);
+ heap_update(pgrel, &tuple->t_self, tuple, NULL);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found;
RelationInvalidateHeapTuple(pgrel, tuple);
- heap_replace(pgrel, &tuple->t_self, tuple, NULL);
+ heap_update(pgrel, &tuple->t_self, tuple, NULL);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.100 1999/11/07 23:08:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.101 1999/11/24 00:44:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* replace the heap tuple
*/
lreplace:;
- result = heap_replace(resultRelationDesc, tupleid, tuple, &ctid);
+ result = heap_update(resultRelationDesc, tupleid, tuple, &ctid);
switch (result)
{
case HeapTupleSelfUpdated:
return;
default:
- elog(ERROR, "Unknown status %u from heap_replace", result);
+ elog(ERROR, "Unknown status %u from heap_update", result);
return;
}
/*
* process indices
*
- * heap_replace updates a tuple in the base relation by invalidating it
+ * heap_update updates a tuple in the base relation by invalidating it
* and then appending a new tuple to the relation. As a side effect,
* the tupleid of the new tuple is placed in the new tuple's t_ctid
* field. So we now insert index tuples using the new tupleid stored
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.38 1999/11/22 17:56:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.39 1999/11/24 00:44:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Assert(HeapTupleIsValid(tuple));
((Form_pg_class) GETSTRUCT(tuple))->relhasrules = relhasrules;
- heap_replace(relationRelation, &tuple->t_self, tuple, NULL);
+ heap_update(relationRelation, &tuple->t_self, tuple, NULL);
/* keep the catalog indices up to date */
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.27 1999/11/22 17:56:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.28 1999/11/24 00:44:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
repl);
setheapoverride(true);
- heap_replace(procrel, &tup->t_self, newtup, NULL);
+ heap_update(procrel, &tup->t_self, newtup, NULL);
setheapoverride(false);
setoid = newtup->t_data->t_oid;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: heapam.h,v 1.47 1999/10/11 06:28:29 inoue Exp $
+ * $Id: heapam.h,v 1.48 1999/11/24 00:44:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern ItemPointer heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid);
extern Oid heap_insert(Relation relation, HeapTuple tup);
extern int heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid);
-extern int heap_replace(Relation relation, ItemPointer otid, HeapTuple tup,
+extern int heap_update(Relation relation, ItemPointer otid, HeapTuple tup,
ItemPointer ctid);
extern int heap_mark4update(Relation relation, HeapTuple tup, Buffer *userbuf);
extern void heap_markpos(HeapScanDesc scan);