aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/remove.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-01-23 04:32:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-01-23 04:32:23 +0000
commit786f1a59cd44f890b2423e15ba3ab172dab968bf (patch)
tree30a730a13a351ac02264f7f48ab6145eb7c51e17 /src/backend/commands/remove.c
parent7a2a1acd520761b479c9dfc4a8e573aeec626094 (diff)
downloadpostgresql-786f1a59cd44f890b2423e15ba3ab172dab968bf.tar.gz
postgresql-786f1a59cd44f890b2423e15ba3ab172dab968bf.zip
Fix all the places that called heap_update() and heap_delete() without
bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
Diffstat (limited to 'src/backend/commands/remove.c')
-rw-r--r--src/backend/commands/remove.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/commands/remove.c b/src/backend/commands/remove.c
index 7353ae2ca82..bfb2cd8dc91 100644
--- a/src/backend/commands/remove.c
+++ b/src/backend/commands/remove.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.57 2000/12/15 04:08:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.58 2001/01/23 04:32:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -91,7 +91,7 @@ RemoveOperator(char *operatorName, /* operator name */
DeleteComments(tup->t_data->t_oid);
- heap_delete(relation, &tup->t_self, NULL);
+ simple_heap_delete(relation, &tup->t_self);
}
else
@@ -154,8 +154,7 @@ SingleOpOperatorRemove(Oid typeOid)
DeleteComments(tup->t_data->t_oid);
- heap_delete(rel, &tup->t_self, NULL);
-
+ simple_heap_delete(rel, &tup->t_self);
}
heap_endscan(scan);
@@ -266,7 +265,7 @@ RemoveType(char *typeName) /* type name to be removed */
DeleteComments(typeOid);
- heap_delete(relation, &tup->t_self, NULL);
+ simple_heap_delete(relation, &tup->t_self);
ReleaseSysCache(tup);
@@ -278,7 +277,7 @@ RemoveType(char *typeName) /* type name to be removed */
if (!HeapTupleIsValid(tup))
elog(ERROR, "RemoveType: type '%s' does not exist", shadow_type);
- heap_delete(relation, &tup->t_self, NULL);
+ simple_heap_delete(relation, &tup->t_self);
ReleaseSysCache(tup);
@@ -354,7 +353,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
DeleteComments(tup->t_data->t_oid);
- heap_delete(relation, &tup->t_self, NULL);
+ simple_heap_delete(relation, &tup->t_self);
ReleaseSysCache(tup);
@@ -428,7 +427,7 @@ RemoveAggregate(char *aggName, char *aggType)
DeleteComments(tup->t_data->t_oid);
- heap_delete(relation, &tup->t_self, NULL);
+ simple_heap_delete(relation, &tup->t_self);
ReleaseSysCache(tup);