Re: pgsql: Restrict the use of temporary namespace in two-phase transaction
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-19T00:08:27Z
Lists: pgsql-hackers
On Fri, Jan 18, 2019 at 03:34:30PM -0500, Tom Lane wrote: > 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. CREATE EXTENSION is one such case. It would not work if referring to the synonym pg_temp, but it can work if using directly the temporary namespace of the session. So I feel that changing such things is prone to break more things than to actually fix things. > 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. This is documented at the top of namespace.c: "initial GUC processing of search_path happens outside a transaction". -- Michael
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