Re: BUG #1234: prepared statements and libpq don't work as expected - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1234: prepared statements and libpq don't work as expected
Date
Msg-id 10549.1093617523@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1234: prepared statements and libpq don't work as expected  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.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

pgsql-bugs by date:

Previous
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1235: didn't compile
Next
From: Tom Lane
Date:
Subject: Re: BUG #1235: didn't compile