Rename heap_replace to heap_update.
This commit is contained in:
parent
6f9ff92cc0
commit
bb10bf319e
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@ -22,7 +22,7 @@
|
||||
* 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
|
||||
*
|
||||
@ -1339,10 +1339,10 @@ l1:
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@ -1376,7 +1376,7 @@ l2:
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@ -102,7 +102,7 @@ ChangeAcl(char *relname,
|
||||
* 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);
|
||||
@ -151,7 +151,7 @@ ChangeAcl(char *relname,
|
||||
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 */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@ -1763,7 +1763,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
|
||||
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);
|
||||
@ -2085,7 +2085,7 @@ AddRelationRawConstraints(Relation rel,
|
||||
|
||||
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,
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@ -839,7 +839,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
|
||||
|
||||
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);
|
||||
@ -1429,7 +1429,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
||||
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);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@ -791,7 +791,7 @@ OperatorDef(char *operatorName,
|
||||
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
|
||||
@ -921,7 +921,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
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)
|
||||
@ -955,7 +955,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
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)
|
||||
@ -995,7 +995,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
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)
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -482,7 +482,7 @@ TypeCreate(char *typeName,
|
||||
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;
|
||||
@ -559,7 +559,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
|
||||
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 */
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -509,7 +509,7 @@ AtCommit_Notify()
|
||||
{
|
||||
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];
|
||||
@ -775,7 +775,7 @@ ProcessIncomingNotify(void)
|
||||
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];
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@ -474,7 +474,7 @@ PerformAddAttribute(char *relationName,
|
||||
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);
|
||||
|
@ -157,7 +157,7 @@ void CreateComments(Oid oid, char *comment) {
|
||||
|
||||
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);
|
||||
@ -165,7 +165,7 @@ void CreateComments(Oid oid, char *comment) {
|
||||
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;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -156,7 +156,7 @@ renameatt(char *relname,
|
||||
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);
|
||||
@ -291,7 +291,7 @@ renamerel(char *oldrelname, char *newrelname)
|
||||
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);
|
||||
|
@ -250,7 +250,7 @@ CreateTrigger(CreateTrigStmt *stmt)
|
||||
|
||||
((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);
|
||||
@ -329,7 +329,7 @@ DropTrigger(DropTrigStmt *stmt)
|
||||
|
||||
((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);
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1350,7 +1350,7 @@ ExecReplace(TupleTableSlot *slot,
|
||||
* replace the heap tuple
|
||||
*/
|
||||
lreplace:;
|
||||
result = heap_replace(resultRelationDesc, tupleid, tuple, &ctid);
|
||||
result = heap_update(resultRelationDesc, tupleid, tuple, &ctid);
|
||||
switch (result)
|
||||
{
|
||||
case HeapTupleSelfUpdated:
|
||||
@ -1378,7 +1378,7 @@ lreplace:;
|
||||
return;
|
||||
|
||||
default:
|
||||
elog(ERROR, "Unknown status %u from heap_replace", result);
|
||||
elog(ERROR, "Unknown status %u from heap_update", result);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1396,7 +1396,7 @@ lreplace:;
|
||||
/*
|
||||
* 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
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -106,7 +106,7 @@ setRelhasrulesInRelation(Oid relationId, bool relhasrules)
|
||||
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);
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -114,7 +114,7 @@ SetDefine(char *querystr, char *typename)
|
||||
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;
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -259,7 +259,7 @@ extern void heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tup, Buff
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user