aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/trigger.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/trigger.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/trigger.c')
-rw-r--r--src/backend/commands/trigger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index ccb2aa5fce3..2775de5e70e 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.83 2001/01/22 00:50:07 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.84 2001/01/23 04:32:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -277,7 +277,7 @@ CreateTrigger(CreateTrigStmt *stmt)
stmt->relname);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found + 1;
- heap_update(pgrel, &tuple->t_self, tuple, NULL);
+ simple_heap_update(pgrel, &tuple->t_self, tuple);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
@@ -333,7 +333,7 @@ DropTrigger(DropTrigStmt *stmt)
DeleteComments(tuple->t_data->t_oid);
- heap_delete(tgrel, &tuple->t_self, NULL);
+ simple_heap_delete(tgrel, &tuple->t_self);
tgfound++;
}
else
@@ -362,7 +362,7 @@ DropTrigger(DropTrigStmt *stmt)
stmt->relname);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found;
- heap_update(pgrel, &tuple->t_self, tuple, NULL);
+ simple_heap_update(pgrel, &tuple->t_self, tuple);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
@@ -404,7 +404,7 @@ RelationRemoveTriggers(Relation rel)
DeleteComments(tup->t_data->t_oid);
- heap_delete(tgrel, &tup->t_self, NULL);
+ simple_heap_delete(tgrel, &tup->t_self);
found = true;
}
@@ -435,7 +435,7 @@ RelationRemoveTriggers(Relation rel)
RelationGetRelid(rel));
((Form_pg_class) GETSTRUCT(tup))->reltriggers = 0;
- heap_update(pgrel, &tup->t_self, tup, NULL);
+ simple_heap_update(pgrel, &tup->t_self, tup);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tup);
CatalogCloseIndices(Num_pg_class_indices, ridescs);