Hello, At present i have the following Schema 1 ------------- Table: events Public Schema ------------- Table: events Function CREATE OR REPLACE FUNCTION "public"."recurring_events_for" ( "range_start" timestamp, "range_end" timestamp, "time_zone" varchar, "events_limit" integer ) RETURNS SETOF "events" AS .... If i set the search path to schema1,public the function still returns rows from the events table in the public schema. Iwould like to use the same function for both schema's. I'm sure i'm missing something obvious, can anyone help me understandthis better ? Thanks -- Troy Rasiah
Troy Rasiah <troyr@vicnet.net.au> writes:
> If i set the search path to schema1,public the function still returns
> rows from the events table in the public schema.
What's probably happening is that plpgsql caches the execution plan for
the SELECT during the first execution of the function in any given
session. The only really reliable way around that is to use EXECUTE
instead of an in-line statement.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера