File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/backend/access/transam Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 77 * Portions Copyright (c) 1994, Regents of the University of California
88 *
99 * IDENTIFICATION
10- * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.27 2007/01/16 13:28:56 alvherre Exp $
10+ * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.28 2007/02/13 19:39:42 tgl Exp $
1111 *
1212 * NOTES
1313 * Each global transaction is associated with a global transaction
@@ -393,6 +393,18 @@ LockGXact(const char *gid, Oid user)
393393 errmsg ("permission denied to finish prepared transaction" ),
394394 errhint ("Must be superuser or the user that prepared the transaction." )));
395395
396+ /*
397+ * Note: it probably would be possible to allow committing from another
398+ * database; but at the moment NOTIFY is known not to work and there
399+ * may be some other issues as well. Hence disallow until someone
400+ * gets motivated to make it work.
401+ */
402+ if (MyDatabaseId != gxact -> proc .databaseId )
403+ ereport (ERROR ,
404+ (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
405+ errmsg ("prepared transaction belongs to another database" ),
406+ errhint ("Connect to the database where the transaction was prepared to finish it." )));
407+
396408 /* OK for me to lock it */
397409 gxact -> locking_xid = GetTopTransactionId ();
398410
You can’t perform that action at this time.
0 commit comments