Re: ON COMMIT options for non temporary tables
Michael Paquier <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.general |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Nov 21, 2019 at 05:13:31PM +0100, Laurenz Albe wrote: > How should that work for tables other than temporary tables? > Should COMMIT lock if somebody else accesses the table? Postgres does not support read uncommitted, so the table would not be visible to other sessions until the transaction that created it is committed. Anyway, the goal is to use the table just within a transaction without having it produce WAL, right? > What keeps you from explicitly dropping the table right before > you commit? Yeah, that would be the most simple. Another idea I can think of here is to use a combination of event trigger and deferred triggered on a dummy constraint: register the table creation using the event trigger on CREATE TABLE, and then drop it using the deferred trigger. Using a DROP TABLE before the commit or once your transaction is done with this table is much more simple of course :) -- Michael
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3Xjc0ACgkQnvQgOdby QH0+LQ//c1k+AW5tFiXG+ghi5MwzLXRBv75slGq7VXhS8nuzQTVXJEYTMOT03KtL bnmqQZn+JckXo0o+1auT5Xt+/NpqqMa2auaeomilIMg2OaOd5TE6TPsawZKF1vDX XjwjsoVFGSdikLRflgb3W/L4IbFnXZB/nsyX7n/P5A4WXqKUYikD5pYfwRNfZwJh JAtBeb4WpTPScQPz6DaJezw/wMOqXFlM2SK3MhIoRa8xVP1nTUAcymIbx7fhWTkZ NP1JW27PA/s45p6oGcU8MtXusKYxvrMcNaMI1BCL/4zYQ89k7QUJLPatdF6krpLc K00WDsnmxsRoGgrQi/a2zhtpNl2G5j+C303GIux0z+qBnCMJZQlMiJxlqPIyVCKZ 7itoAE0fxuG1jus6yZdw4Z1LYBdHyTj6iby5PvvEgF6KAILV256cKSia2IEBOKx6 tM5QwF/Uuf/t9Jdb51jJj4Dt616zcfO0oBaEswtqou2sNmmsnCOJIQyvrJvxXtrf yOFz0lgQ491oVByil/w3New8B2hJdTrGifQlOSm+4Uft0cSTwg1CnZI4gr9Whv5R QrsPDjTkcb7znFvmblq0UkQTCXiGPxfJqQmrGWKcfXnAL5vpsmlaP9kilvqOkrEr IRrcBgG8VKVryPFpk1wt5AosZrd3dgwiDpFNYERizsy1xBz1C3M= =Mk3u -----END PGP SIGNATURE-----