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: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: 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-20 14:46:37
Message-ID: 31971.1453301197@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com> writes:
> Here's my question: why change in search_path does NOT generate
> ParameterStatus message from the backend?

The protocol specification includes a list of the small number of GUCs
for which ParameterStatus messages are generated, and that is not one
of them.

This has been discussed before, I believe, and the conclusion was that
if you think you need this, you're doing it wrong. More robust solutions
involve having individual functions use SET clauses to locally force
search_path to be what they want. If we had search_path marked as
GUC_REPORT, that would both lead to a storm of useless client messages
when such techniques were in use, and encourage people to use methods
that won't really work reliably.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2016-01-20 14:55:09 Re: Batch update of indexes
Previous Message Fujii Masao 2016-01-20 14:32:24 removal of unused argument in ginInsertCleanup()