Re: BUG #1234: prepared statements and libpq don't work as expected

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sven Riedel" <sr(at)gimp(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1234: prepared statements and libpq don't work as expected
Date: 2004-08-27 14:38:43
Message-ID: 10549.1093617523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> The code in question looks like this:

> static const char *prepareuserquery =
> "PREPARE UserQuery (text,text) AS SELECT UserID FROM Users WHERE Name=$1
> AND Password=$2";

> if( ( result = PQexecPrepared( sqlhandle, "UserQuery", 2, (const char*
> const *)parameters, NULL, param_format, 1 ) ) == NULL ) {

You've got an identifier-case problem. The statement name argument to
PQexecPrepared is taken literally (as if double-quoted), but the name
appearing in the PREPARE command will have been effectively folded to
lower case.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-08-27 14:45:32 Re: BUG #1235: didn't compile
Previous Message PostgreSQL Bugs List 2004-08-27 13:13:08 BUG #1235: didn't compile