diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-07 13:14:46 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-07 13:15:15 -0400 |
commit | a195e3c34f1eeb6a607c342121edf48e49067ea9 (patch) | |
tree | 75dbe45ab465bbe8bc519db9856ac761a2a2a6b7 /src/backend/commands/trigger.c | |
parent | 928408d9e5b4b389897b799b3b6af505d719a3f6 (diff) | |
download | postgresql-a195e3c34f1eeb6a607c342121edf48e49067ea9.tar.gz postgresql-a195e3c34f1eeb6a607c342121edf48e49067ea9.zip |
Finish disabling reduced-lock-levels-for-DDL feature.
Previous patch only covered the ALTER TABLE changes, not changes in other
commands; and it neglected to revert the documentation changes.
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 8072c776879..9cf8372e967 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -144,14 +144,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, ObjectAddress myself, referenced; - /* - * ShareRowExclusiveLock is sufficient to prevent concurrent write - * activity to the relation, and thus to lock out any operations that - * might want to fire triggers on the relation. If we had ON SELECT - * triggers we would need to take an AccessExclusiveLock to add one of - * those, just as we do with ON SELECT rules. - */ - rel = heap_openrv(stmt->relation, ShareRowExclusiveLock); + rel = heap_openrv(stmt->relation, AccessExclusiveLock); /* * Triggers must be on tables or views, and there are additional @@ -481,7 +474,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, * can skip this for internally generated triggers, since the name * modification above should be sufficient. * - * NOTE that this is cool only because we have ShareRowExclusiveLock on + * NOTE that this is cool only because we have AccessExclusiveLock on * the relation, so the trigger set won't be changing underneath us. */ if (!isInternal) @@ -1085,14 +1078,11 @@ RemoveTriggerById(Oid trigOid) elog(ERROR, "could not find tuple for trigger %u", trigOid); /* - * Open and lock the relation the trigger belongs to. As in - * CreateTrigger, this is sufficient to lock out all operations that could - * fire or add triggers; but it would need to be revisited if we had ON - * SELECT triggers. + * Open and exclusive-lock the relation the trigger belongs to. */ relid = ((Form_pg_trigger) GETSTRUCT(tup))->tgrelid; - rel = heap_open(relid, ShareRowExclusiveLock); + rel = heap_open(relid, AccessExclusiveLock); if (rel->rd_rel->relkind != RELKIND_RELATION && rel->rd_rel->relkind != RELKIND_VIEW) |