Re: [PATCHES] prepareable statements - Mailing list pgsql-hackers

From nconway@klamath.dyndns.org (Neil Conway)
Subject Re: [PATCHES] prepareable statements
Date
Msg-id 20020723164615.GB8761@klamath.dyndns.org
Whole thread Raw
In response to Re: [PATCHES] prepareable statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses why?  ("John Liu" <johnl@synthesys.com>)
List pgsql-hackers
On Sat, Jul 20, 2002 at 10:00:01PM -0400, Tom Lane wrote:
> * In gram.y: put the added keywords in the appropriate keyword-list
> production (hopefully the unreserved one).

I think the patch already does this, doesn't it? If not, what else
needs to be modified?

> * Syntax for prepare_type_list is not good; it allows
>             ( , int )

Erm, I don't see that it does. The syntax is:

prep_type_list: Typename            { $$ = makeList1($1); }
              | prep_type_list ',' Typename
                                    { $$ = lappend($1, $3); }
              ;

(i.e. there's no ' /* EMPTY */ ' case)

> * Why does QueryData contain a context field?

Because the context in which the query data is stored needs to be
remembered so that it can be deleted by DeallocateQuery(). If
DEALLOCATE goes away, this should also be removed.

I've attached a revised patch, which includes most of Tom's suggestions,
with the exception of the three mentioned above. The syntax is now:

PREPARE q1(int, float, text) AS ...;

EXECUTE q1(5, 10.0, 'foo');

DEALLOCATE q1;

I'll post an updated patch to -patches tomorrow that gets rid of
DEALLOCATE. I also need to check if there is a need for executor_stats.
Finally, should the syntax for EXECUTE INTO be:

EXECUTE q1(...) INTO foo;

or

EXECUTE INTO foo q1(...);

The current patch uses the former, which I personally prefer, but
I'm not adamant about it.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachment

pgsql-hackers by date:

Previous
From: ramirez@idconcepts.org (Edwin S. Ramirez)
Date:
Subject: Oracle Decode Function
Next
From: "John Liu"
Date:
Subject: why?