Re: pgsql: Restrict the use of temporary namespace in two-phase transaction
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-18T20:34:30Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Thu, Jan 17, 2019 at 8:08 PM Tom Lane <tgl@sss.pgh.pa.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
Commits
-
Adjust error message
- eb69147e67ab 10.7 landed
- 12055c8f643a 11.2 landed
-
Enforce non-parallel plan when calling current_schema() in newly-added test
- 08b53281f444 10.7 landed
- 3daac78d983f 11.2 landed
- 396676b0ec4b 12.0 landed
-
Restrict the use of temporary namespace in two-phase transactions
- c5660e0aa52d 12.0 cited