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
Attachment:
signature.asc
Description: PGP signature