Re: wrong search_path being used - Mailing list pgsql-bugs

From Tom Lane
Subject Re: wrong search_path being used
Date
Msg-id 21642.1358018978@sss.pgh.pa.us
Whole thread Raw
In response to Re: wrong search_path being used  ("Kevin Grittner" <kgrittn@mail.com>)
Responses Re: wrong search_path being used
List pgsql-bugs
"Kevin Grittner" <kgrittn@mail.com> writes:
> To try to get your function code to work as you expect, the
> language would essentially need to identify which statements could
> be pre-planned, and which would needed to be treated as raw source
> on each execution. That would be tricky to implement, and would
> itself have some run-time cost. At this point we've put the burden
> on the programmer to identify this at the time the code is written,
> rather than adding run-time expense.

I think that the alternative most likely to succeed is to consider any
change in the active value of search_path as forcing replanning of
cached plans.  This wouldn't be that hard to implement but there's
a definite risk of loss of performance due to unnecessary replanning
(since the path change might or might not affect the particular query).
It's also not unlikely that it could break applications that work today,
because they depend -- perhaps without being aware of it -- on the
existing first-path-wins behavior.

Having said that, it seems likely that more people would prefer that
behavior than the existing one.  But it hasn't been clear enough to
justify making such a subtly incompatible change.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: wrong search_path being used
Next
From: Andres Freund
Date:
Subject: Re: wrong search_path being used