RE: SQL statement PREPARE does not work in ECPG

Поиск
Список
Период
Сортировка
От Matsumura, Ryo
Тема RE: SQL statement PREPARE does not work in ECPG
Дата
Msg-id 03040DFF97E6E54E88D3BFEE5F5480F737AD6C13@G01JPEXMBYT04
обсуждение исходный текст
Ответ на Re: SQL statement PREPARE does not work in ECPG  (Michael Meskes <meskes@postgresql.org>)
Ответы Re: SQL statement PREPARE does not work in ECPG
Список pgsql-hackers
Meskes-san

Thank you for your comment.

> One question though, why is the statement name always quoted? Do we
> really need that? Seems to be more of a hassle than and advantage.

The following can be accepted by preproc, ecpglib, libpq, and backend in previous versions.
  exec sql prepare "st x" from "select 1";
  exec sql execute "st x";

The above was preprocessed to the following.
  PQprepare(conn, "\"st x\"", "select 1");
  PQexec(conn, "\"st x\"");

By the way, the following also can be accepted.
  PQexecParams(conn, "prepare \"st x\" ( int ) as select $1", 0, NULL, NULL, NULL, NULL, 0);
  PQexecParams(conn, "execute \"st x\"( 1 )", 0, NULL, NULL, NULL, NULL, 0);

Therefore, I think that the quoting statement name is needed in PREPARE/EXECUTE case, too.

> I would prefer to merge as much as possible, as I am afraid that if we
> do not merge the approaches, we will run into issues later. There was a
> reason why we added PQprepare, but I do not remember it from the top of
> my head. Need to check when I'm online again.

I will also consider it.

Regards
Ryo Matsumura

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

Предыдущее
От: Michael Banck
Дата:
Сообщение: Re: Online verification of checksums
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_basebackup ignores the existing data directory permissions