Re: parameterized fetch - Mailing list pgsql-hackers

From Oliver Jowett
Subject Re: parameterized fetch
Date
Msg-id 4328AA0E.7090202@opencloud.com
Whole thread Raw
In response to parameterized fetch  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers
Merlin Moncure wrote:
> I've noticed that trying to parameterize a fetch statement via
> ExecParams returns a syntax error:
> 
> fetch $1 from my_cursor;
> 
> This is not really a big deal, but maybe it should be documented which
> statements can be parameterized and which can't

Currently the documentation is "the backend's grammar". You can only put
parameters where there is a PARAM node, which currently means "anywhere
you can put a c_expr". So if you can replace something with an
expression, you can probably also replace it with a parameter.

-O


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Constraint Type Coercion issue?
Next
From: "Michael Paesold"
Date:
Subject: Bug with cursor declaration in PL/pgSQL in CVS tip?