Re: Shouldn't current_schema() be at least PARALLEL RESTRICTED? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Shouldn't current_schema() be at least PARALLEL RESTRICTED?
Date
Msg-id 20190119012052.GB3306@paquier.xyz
Whole thread Raw
In response to Re: Shouldn't current_schema() be at least PARALLEL RESTRICTED?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: House style for DocBook documentation?
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0