Re: Use of search path in plpgsql functions, PG 8.3.12

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Troy Rasiah <troyr(at)vicnet(dot)net(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Use of search path in plpgsql functions, PG 8.3.12
Date: 2010-11-25 15:54:15
Message-ID: 12963.1290700455@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Troy Rasiah <troyr(at)vicnet(dot)net(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin & Jessica Hermansen 2010-11-25 23:13:13 Dear Friends: a 123h
Previous Message Matthew Walden 2010-11-25 14:56:30 Re: Postgres 9.01 and WAL files issue