diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-04 19:54:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-04 19:54:13 +0000 |
commit | f3032cbe377ecc570989e1bd2fe1aea455c12cc3 (patch) | |
tree | 0ebdb8d2fefe61172d2c3cabdef0fb5f41da6373 /src/backend/storage/lmgr/lock.c | |
parent | 089e1a86ca7bd3a48857b91d67d756d11cf0d434 (diff) |
Fix PREPARE TRANSACTION to reject the case where the transaction has dropped a
temporary table; we can't support that because there's no way to clean up the
source backend's internal state if the eventual COMMIT PREPARED is done by
another backend. This was checked correctly in 8.1 but I broke it in 8.2 :-(.
Patch by Heikki Linnakangas, original trouble report by John Smith.
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
-rw-r--r-- | src/backend/storage/lmgr/lock.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 24f9b7782ed..c3c26698915 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.181 2008/02/02 22:26:17 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.181.2.1 2008/03/04 19:54:13 tgl Exp $ * * NOTES * A lock table is a shared memory hash table. When @@ -37,7 +37,6 @@ #include "access/twophase_rmgr.h" #include "miscadmin.h" #include "pgstat.h" -#include "storage/lmgr.h" #include "utils/memutils.h" #include "utils/ps_status.h" #include "utils/resowner.h" @@ -1871,12 +1870,6 @@ AtPrepare_Locks(void) elog(ERROR, "cannot PREPARE when session locks exist"); } - /* Can't handle it if the lock is on a temporary object */ - if (LockTagIsTemp(&locallock->tag.lock)) - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot PREPARE a transaction that has operated on temporary tables"))); - /* * Create a 2PC record. */ |