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

From Tom Lane
Subject Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()
Date
Msg-id 14368.1158413320@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()  ("Andy McCurdy" <andy.mccurdy@emergent.net>)
List 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 by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()
Next
From: "Ross Elliott"
Date:
Subject: BUG #2631: database locking problem