the parsing of parameters - Mailing list pgsql-hackers

From Neil Conway
Subject the parsing of parameters
Date
Msg-id 20020430201110.638a8962.nconway@klamath.dyndns.org
Whole thread Raw
Responses Re: the parsing of parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
specifiedin "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@rogers.com>
PGP Key ID: DB3C29FC


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Schemas: status report, call for developers
Next
From: Ian Barwick
Date:
Subject: Re: Schemas: status report, call for developers