Re: pgsql: Restrict the use of temporary namespace in two-phase transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Restrict the use of temporary namespace in two-phase transaction
Date: 2019-01-18 20:34:30
Message-ID: 499.1547843670@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Jan 17, 2019 at 8:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Anyway, it seems to me that this is pointing out to another issue:
>>> current_schema() can trigger a namespace creation, hence shouldn't we
>>> mark it as PARALLEL UNSAFE and make sure that we never run into this
>>> problem?

>> That seems a bit annoying, but maybe we have little choice?

> The only other option I see is to make current_schema() not trigger a
> namespace creation.

Seems hard to avoid. We could conceivably make it return "pg_temp"
for the temp schema instead of the schema's actual name, but it's
not very hard to think of ways whereby that would make use of the
result fail in contexts where it previously worked.

Another idea is to force creation of the temp namespace as soon as
we see that search_path references it. I'm not very sure exactly
where would be a convenient place to make that happen, though.
There are paths whereby the GUC's value will change outside a
transaction, so we couldn't tie it directly to the GUC update.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-01-19 00:04:20 Re: pgsql: Remove references to Majordomo
Previous Message Tom Lane 2019-01-18 20:23:49 pgsql: Fix under-quoted filename pattern in pgbench TAP test.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-01-18 20:34:46 Re: Early WIP/PoC for inlining CTEs
Previous Message Robert Haas 2019-01-18 20:30:16 Re: Shouldn't current_schema() be at least PARALLEL RESTRICTED?