Re: Shouldn't current_schema() be at least PARALLEL RESTRICTED?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-19T01:20:52Z
Lists: pgsql-hackers
Attachments
- current-schema-unsafe.patch (text/x-diff) patch
On Fri, Jan 18, 2019 at 03:30:16PM -0500, Robert Haas wrote: > It seems like, as currently implemented, the function is > parallel-unsafe, because any inserts, updates, or deletes are > currently parallel-unsafe, including insertions into catalogs. But I > am a bit confused why a function that is called current_schema() ends > up creating a temps schema. This is documented in namespace.c which needs tricks related to search_path if referring directly to 'pg_temp', especially if the namespace creation is marked as pending because its creation cannot happen outside a transaction context, and the initialization processing of search_path happens out of that. Please let me suggest the attached patch then to switch the function as parallel unsafe, for HEAD. That still seems like the best way of course for now after sleeping on it. Thoughts? -- Michael
Commits
-
Switch function current_schema[s]() to be parallel-unsafe
- 5bde1651bbba 12.0 landed