Re: Executing prepared statements via bind params - Mailing list pgsql-general

From Tom Lane
Subject Re: Executing prepared statements via bind params
Date
Msg-id 26496.1308259181@sss.pgh.pa.us
Whole thread Raw
In response to Executing prepared statements via bind params  (Peter Bex <Peter.Bex@xs4all.nl>)
Responses Re: Executing prepared statements via bind params  (Peter Bex <Peter.Bex@xs4all.nl>)
List pgsql-general
Peter Bex <Peter.Bex@xs4all.nl> writes:
> But when I try to do the same but pas the 2 as a parameter,
> (I do "EXECUTE bar($1)" with $1 bound to "2"), I get an error:

Why would you do that, rather than executing the prepared statement
directly with PQexecPrepared?  Interposing an EXECUTE doesn't do
anything but add parsing overhead.

The reason this particular case doesn't work is that utility statements
(including EXECUTE) don't have any support for $n parameters.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: PostgreSQL 8.4.8 bringing my website down every evening
Next
From: Peter Bex
Date:
Subject: Re: Executing prepared statements via bind params