Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()
Дата
Msg-id 14368.1158413320@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()  ("Andy McCurdy" <andy.mccurdy@emergent.net>)
Список pgsql-bugs
"Andy McCurdy" <andy.mccurdy@emergent.net> writes:
> result = PQprepare(conn, "MyQuery", "select * from pg_stat_activity", 0,
> NULL);

I believe the above will result in preparing a statement named "MyQuery",
ie, no case-folding happens on the second argument of PQprepare, because
it never goes through the SQL parser.

> /*
> THE FOLLOW PQEXEC() FAILS.  Error message says:  ERROR:  prepared statement
> "myquery" does not exist"
> */
> result = PQexec(conn, "DEALLOCATE MyQuery");

I think this would work:

result = PQexec(conn, "DEALLOCATE \"MyQuery\"");

            regards, tom lane

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()
Следующее
От: "Ross Elliott"
Дата:
Сообщение: BUG #2631: database locking problem