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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Set search_path + server-prepared statements = cached plan must not change result type
Date: 2016-01-25 17:56:57
Message-ID: 15792.1453744617@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-01-25 18:02:02 Re: 2016-01 Commitfest
Previous Message Andres Freund 2016-01-25 17:54:20 Re: 2016-01 Commitfest