pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PQprepare case sensitive?
5+ messages / 2 participants
[nested] [flat]

* PQprepare case sensitive?
@ 2007-06-08 12:33  Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Meskes @ 2007-06-08 12:33 UTC (permalink / raw)
  To: pgsql-interfaces

I haven't looked into the sources yet, but PQprepare's behaviour in my
new ecpglib code suggests that the statement name is case sensitive. Is
this by design? I wonder because a statement like this cannot be
deallocated afterwards since the parser is case insensitive with regard
to statement names.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PQprepare case sensitive?
@ 2007-06-08 13:56  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2007-06-08 13:56 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: pgsql-interfaces

Michael Meskes <meskes@postgresql.org> writes:
> I haven't looked into the sources yet, but PQprepare's behaviour in my
> new ecpglib code suggests that the statement name is case sensitive. Is
> this by design?

Yes, it's assumed that any quoting/dequoting has already happened by the
time the name gets into the protocol message.

> I wonder because a statement like this cannot be
> deallocated afterwards since the parser is case insensitive with regard
> to statement names.

Sure it can --- use quotes.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PQprepare case sensitive?
@ 2007-06-08 14:58  Michael Meskes <meskes@postgresql.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Meskes @ 2007-06-08 14:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Michael Meskes <meskes@postgresql.org>; pgsql-interfaces

On Fri, Jun 08, 2007 at 09:56:42AM -0400, Tom Lane wrote:
> Yes, it's assumed that any quoting/dequoting has already happened by the
> time the name gets into the protocol message.

But shouldn't this be documented? I failed to find it. But then this
wouldn't be the first time I fail to find the right place in
documentation.

> > I wonder because a statement like this cannot be
> > deallocated afterwards since the parser is case insensitive with regard
> > to statement names.
> 
> Sure it can --- use quotes.

True of course. My wording was bad. I meant with the same way of writing
the name. 

Again, I have no problem with this behaviour I just wanted to make sure
it's supposed to be this way before I start implementing ecpg's handling
of this.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PQprepare case sensitive?
@ 2007-06-08 15:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2007-06-08 15:05 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: pgsql-interfaces

Michael Meskes <meskes@postgresql.org> writes:
> On Fri, Jun 08, 2007 at 09:56:42AM -0400, Tom Lane wrote:
>> Yes, it's assumed that any quoting/dequoting has already happened by the
>> time the name gets into the protocol message.

> But shouldn't this be documented? I failed to find it. But then this
> wouldn't be the first time I fail to find the right place in
> documentation.

Well, the point is that downcasing and quote-stripping are things that
happen in the context of parsing names within SQL statements.  We don't
do that for other names that are sent by themselves in the protocol,
such as user and database names in the startup message.  So I would not
expect it to happen for statement names either.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PQprepare case sensitive?
@ 2007-06-08 20:36  Michael Meskes <meskes@postgresql.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Meskes @ 2007-06-08 20:36 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Michael Meskes <meskes@postgresql.org>; pgsql-interfaces

On Fri, Jun 08, 2007 at 11:05:28AM -0400, Tom Lane wrote:
> Well, the point is that downcasing and quote-stripping are things that
> happen in the context of parsing names within SQL statements.  We don't
> do that for other names that are sent by themselves in the protocol,
> such as user and database names in the startup message.  So I would not
> expect it to happen for statement names either.

Valid point. However, I had the statement name in a variable and used it
for prepare and deallocate. It just happened that it had upper case
letters and things didn't work. :-)

Anyway, I fix my code.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2007-06-08 20:36 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-06-08 12:33 PQprepare case sensitive? Michael Meskes <meskes@postgresql.org>
2007-06-08 13:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2007-06-08 14:58   ` Michael Meskes <meskes@postgresql.org>
2007-06-08 15:05     ` Tom Lane <tgl@sss.pgh.pa.us>
2007-06-08 20:36       ` Michael Meskes <meskes@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox