Prepare Transaction support for ON COMMIT DROP temporary tables - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Prepare Transaction support for ON COMMIT DROP temporary tables
Date
Msg-id m2d0pllvqy.fsf@dimitris-macbook-pro.home
Whole thread Raw
Responses Re: Prepare Transaction support for ON COMMIT DROP temporary tables
Re: Prepare Transaction support for ON COMMIT DROP temporary tables
List pgsql-hackers
Hi,

Please find attached a patch to enable support for temporary tables in
prepared transactions when ON COMMIT DROP has been specified.

The comment in the existing code around this idea reads:

     * Don't allow PREPARE TRANSACTION if we've accessed a temporary table in
     * this transaction.
         [ ... ]
     * XXX In principle this could be relaxed to allow some useful special
     * cases, such as a temp table created and dropped all within the
     * transaction.  That seems to require much more bookkeeping though.

In the attached patch I have added this paragraph, and of course the
implementation of it:

     * A special case of this situation is using ON COMMIT DROP, where the
     * call to PreCommit_on_commit_actions() is then responsible for
     * performing the DROP table within the transaction and before we get
     * here.

Regards,
-- 
dim


Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: could recovery_target_timeline=latest be the default in standbymode?
Next
From: Vik Fearing
Date:
Subject: Re: Prepare Transaction support for ON COMMIT DROP temporary tables