diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-04 19:54:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-04 19:54:23 +0000 |
commit | cbcc5b11a819593c3b45ebccaeecea0f631e00f1 (patch) | |
tree | 7b925dd1338163aa6091f0ed8421068f8d9c0672 /src/backend/storage/lmgr/lock.c | |
parent | a27e4ecda98f6b3f6e586179e3e977d61d99a144 (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 a8d2ad01d9f..a49002e4d07 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.174.2.1 2008/02/02 22:26:23 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.174.2.2 2008/03/04 19:54:23 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" @@ -1849,12 +1848,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. */ |