Re: 'prepare' is not quite schema-safe - Mailing list pgsql-general

From Tom Lane
Subject Re: 'prepare' is not quite schema-safe
Date
Msg-id 9369.1114998407@sss.pgh.pa.us
Whole thread Raw
In response to 'prepare' is not quite schema-safe  (Vlad <marchenko@gmail.com>)
Responses Re: 'prepare' is not quite schema-safe
Re: 'prepare' is not quite schema-safe
List pgsql-general
Vlad <marchenko@gmail.com> writes:
> SET search_path TO one;

> PREPARE st( VARCHAR(20) ) AS SELECT * FROM test WHERE item = $1;

> EXECUTE st( 'one' );

> SET search_path TO two;

> -- next statement fails because st selects from one.test, not from two.test
> EXECUTE st( 'two' );

That's what it is supposed to do.  It would hardly be possible to
"prepare" a query at all if we had to wait till EXECUTE to find out
which tables it was supposed to use.

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: could not load library plperl.so
Next
From: Tom Lane
Date:
Subject: Re: could not load library plperl.so