Peter Eisentraut wrote:
> Merlin Moncure wrote:
> > While using the PQExecPrepared interface, the statement name passed
> > to the function (as a const char*) has to be in lower case to get it
> > to work.  I kind of understand why this is, but it is kind of weird
> > that passing the exact same statement name to PQExecPrepared and
> > PREPARE does not work if it contains any upper case characters.
> 
> PQExecPrepared is used in C programs, PREPARE is used in SQL programs.
> I think it's fairly obvious that those use different syntax rules.

Well, yes :)  Just to be absolutely clear what I mean, the following
will fail (pseudocode, but you get the idea):

char stmt[] = "prepare X as select 0()";
PQexec(c, "execute X"); <-- works
PQexecPrepared(c, "X" [...]); <-- fails

You are saying this is the correct and expected behavior?

Merlin


Fri, 16 Jul 2004 16:46:50 -0400
"Merlin Moncure" <merlin.moncure@rcsonline.com>
Re: case sensitivity in PQExecPrepared
Merlin Moncure wrote:
> Well, yes :)  Just to be absolutely clear what I mean, the following
> will fail (pseudocode, but you get the idea):
>
> char stmt[] = "prepare X as select 0()";
> PQexec(c, "execute X"); <-- works
> PQexecPrepared(c, "X" [...]); <-- fails
>
> You are saying this is the correct and expected behavior?

Yes, because part of those syntax rules is that in SQL, unquoted 
identifiers are folded to lower case, but in C they are not.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Fri, 16 Jul 2004 23:00:05 +0200
Peter Eisentraut <peter_e@gmx.net>
Re: case sensitivity in PQExecPrepared