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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andy McCurdy" <andy(dot)mccurdy(at)emergent(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()
Date: 2006-09-16 13:28:40
Message-ID: 14368.1158413320@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Andy McCurdy" <andy(dot)mccurdy(at)emergent(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ross Elliott 2006-09-16 22:12:24 BUG #2631: database locking problem
Previous Message Michael Fuhr 2006-09-16 13:08:17 Re: BUG #2629: libpq - Cannot deallocate prepared statement created with PQprepare()