Re: Is temporary functions feature official/supported? Found some issues with it.

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alexey Bashtanov <bashtanov(at)imap(dot)cc>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, Mi Tar <mmitar(at)gmail(dot)com>
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
Date: 2019-01-15 06:36:56
Message-ID: CAD21AoDHDiWU1b+1tQ6tbtvMT=ENHSQdYqJpBoWR4nOEahOCug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 14, 2019 at 9:45 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> 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?

Thank you for updating the patch. The patch looks good to me. And the
new regression test for CREATE EXTENSION seems to work fine but maybe
it's better to reset client_min_messages at cleanup for safety.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-01-15 06:57:17 BUG #15593: Unable to install PostgreSQL
Previous Message Andres Freund 2019-01-14 22:28:38 Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)