Re: Is temporary functions feature official/supported? Found some issues with it.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Alexey Bashtanov <bashtanov@imap.cc>, pgsql-bugs <pgsql-bugs@postgresql.org>, mmitar@gmail.com
Date: 2019-01-14T00:45:20Z
Lists: pgsql-bugs
Attachments
- temp-object-2pc-v2.patch (text/x-diff) patch v2
On Thu, Jan 10, 2019 at 08:44:13PM +0900, Masahiko Sawada wrote: > Yes, IIUC this issue happen only when creating the extension that > doesn't access the function after created it. For example, dblink does > REVOKE for dblink_connect_u() after creation. I am not sure if Robert is a fan of simply forbiding that as per the question here: https://www.postgresql.org/message-id/CA+TgmoZJdGcGFm+coHHCbBM3CfPqpjisdiux4Pa9QA3dFFQasw@mail.gmail.com Anyway, we could take for now the separate approach to prevent the case of CREATE EXTENSION with 2PC if trying to use a temporary schema as more holes are closed with this stuff. Attached is an updated patch to do so. This adds a regression test, which would fail if we decide to prevent the behavior afterwards. This uses two tricks to avoid CONTEXT and NOTICE messages which include the temporary session name to keep the test stable: \set SHOW_CONTEXT never SET client_min_messages TO 'warning'; Thoughts? -- Michael
Commits
-
Restrict the use of temporary namespace in two-phase transactions
- b15160bc716e 10.7 landed
- 3e4fdb3bc0dc 11.2 landed
- c5660e0aa52d 12.0 landed