Re: [PATCHES] prepareable statements

Поиск
Список
Период
Сортировка
От nconway@klamath.dyndns.org (Neil Conway)
Тема Re: [PATCHES] prepareable statements
Дата
Msg-id 20020723164615.GB8761@klamath.dyndns.org
обсуждение исходный текст
Ответ на Re: [PATCHES] prepareable statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы why?  ("John Liu" <johnl@synthesys.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: ramirez@idconcepts.org (Edwin S. Ramirez)
Дата:
Сообщение: Oracle Decode Function
Следующее
От: "John Liu"
Дата:
Сообщение: why?