pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: John McCawley <nospam@hardgeus.com>
Cc: dfx@dfx.it
Cc: pgsql-general@postgresql.org
Subject: Re: Case sensitivity?
Date: Tue, 27 Dec 2005 16:29:25 +0100
Message-ID: <20051227152919.GB32404@svana.org> (raw)
In-Reply-To: <43B15A4C.9040809@hardgeus.com>
References: <000501c60b40$ea790510$fc00a8c0@dfx>
	<43B15A4C.9040809@hardgeus.com>

On Tue, Dec 27, 2005 at 09:14:20AM -0600, John McCawley wrote:
> Due to case weirdness in Postgres, particularly when accessing it from 
> PHP, I completely abandoned mixed case table and column names.  I don't 
> know if things have changed in the past several years, but when I first 
> made the leap, mixed case was more trouble than it was worth.

Well, the rule is very simple, either always quote your identifiers, or
never quote them. If you always quote them, then you always need to
specify them in the same case. If you never quote them, then you always
get case-insensetivity.

> Even after I got over the initial hump and figured out how to make it 
> work, there was enough weird behavior (i.e. being able to access a 
> non-existent array element) in PHP that it led to a lot of bugs when 
> using mixed-case in Postgres.  That's my two cents.  Your mileage may 
> vary...

Hmm, you mean how column titles come back as lowercase? By strict SQL
standard they should come back as all upper-case, but you probably
don't want that either...

SQL has always been case-folding, never case-insensetive.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

view thread (80+ messages)  latest in thread

Message-ID: <20051227152919.GB32404@svana.org>
Permalink:  ../20051227152919.GB32404@svana.org/
Also on:    postgresql.org/message-id/20051227152919.GB32404@svana.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: kleptog@svana.org, nospam@hardgeus.com, dfx@dfx.it
  Subject: Re: Case sensitivity?
  In-Reply-To: <20051227152919.GB32404@svana.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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