the parsing of parameters

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: the parsing of parameters
Date: 2002-05-01 00:11:10
Message-ID: 20020430201110.638a8962.nconway@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm working on a revised patch for PREPARE/EXECUTE. The basic code
has been written (although I've been delayed due to the workload at
school). I'm now trying to add support for preparing queries with
parameters, but it is failing at an early stage of the game:

nconway=> prepare q1 as select 1;
PREPARE
nconway=> prepare q2 as select $1;
ERROR: Parameter '$1' is out of range

(You'll see the same parse error with simply "select $1;")

The shortened version of the grammar I'm using is:

PrepareStmt: PREPARE name AS OptimizableStmt

What modifications need to be made to allow these kinds of
parametized queries?

BTW, is this a legacy from postquel? (from include/nodes/primnodes.h)

--------------
* Param
* paramkind - specifies the kind of parameter. The possible values
* for this field are specified in "params.h", and they are:
*
* PARAM_NAMED: The parameter has a name, i.e. something
* like `$.salary' or `$.foobar'.
--------------

Specifically, the "something like ..." stuff.

Thanks in advance,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Barwick 2002-05-01 01:46:37 Re: Schemas: status report, call for developers
Previous Message Tom Lane 2002-04-30 21:16:33 Re: Schemas: status report, call for developers