Re: Set search_path + server-prepared statements = cached plan must not change result type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Set search_path + server-prepared statements = cached plan must not change result type
Date
Msg-id 15792.1453744617@sss.pgh.pa.us
Whole thread Raw
In response to Re: Set search_path + server-prepared statements = cached plan must not change result type  (Andres Freund <andres@anarazel.de>)
Responses Re: Set search_path + server-prepared statements = cached plan must not change result type  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2016-01-25 12:39:29 -0500, Robert Haas wrote:
>> What is the ideal behavior, in your view?

> FWIW, I think that for a lot of practical cases the previous behaviour,
> where a prepared statement was defined in the context of the search path
> set during the PREPARE, made a lot more sense.

That argument is defensible probably for explicit PREPARE, but not at all
so for preparing done behind the scenes, as plpgsql does it, or as jdbc
does it.  The previous behavior amounted to silent inconsistency for
plpgsql users; statements that weren't obviously different might be
executed with the current search_path or with some previous setting.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: 2016-01 Commitfest
Next
From: Alvaro Herrera
Date:
Subject: Re: 2016-01 Commitfest