Forbid finishing a prepared transaction from another database
Here's a patch to:
Throw an error if you try to COMMIT/ROLLBACK PREPARED from a database
other than the one where the transaction was originally prepared.
This needs to be fixed because at least NOTIFY/LISTEN gets confused, and
sends the notification to the database where the commit is done, not the
database where the transaction ran originally. And there might be other
places that get confused as well.
It turned out to be even simpler than I imagined. :)
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
Attachments:
error_on_cross_database_finish.patchtext/x-patch; name=error_on_cross_database_finish.patchDownload+6-0
Heikki Linnakangas <heikki@enterprisedb.com> writes:
Throw an error if you try to COMMIT/ROLLBACK PREPARED from a database
other than the one where the transaction was originally prepared.
Committed, but I made it ERRCODE_FEATURE_NOT_SUPPORTED, since this seems
to me to be in the nature of something we might fix someday (if anyone
gets motivated enough), not a that's-nonsensical error.
regards, tom lane