pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: alwin <alwin@cs.nl>
Cc: pgsql-admin@postgresql.org
Subject: Re: case insensitive table names
Date: Tue, 12 Oct 2004 10:50:44 -0400
Message-ID: <2292.1097592644@sss.pgh.pa.us> (raw)
In-Reply-To: <6.1.2.0.0.20041012155623.025459c8@localhost>
References: <6.1.2.0.0.20041012155623.025459c8@localhost>

alwin <alwin@cs.nl> writes:
> So far so good. But the current code uses queries without quotes, like
> select * from Table; and not select * from "Table";.

You have a problem :-(

> Is there an easier fix for this? Does the SQL92/SQL3/SQL2003 specify
> unquoted table names to be case-insensitive or does it say it needs to
> be converted to lowercase?

The SQL spec is absolutely clear that the above code is wrong.  What the
spec actually says is that unquoted names should be forced to all upper
case (so Table is equivalent to "TABLE").  Postgres forces them to lower
case (so Table is equivalent to "table") which is not quite the same but
has the same effect that unquoted names are not case sensitive.  But
under both the exact spec rules and our rules, a mixed-case quoted name
is never equivalent to any unquoted name.  There is no such thing as
case insensitivity for quoted names.

			regards, tom lane



view thread (2+ messages)

Message-ID: <2292.1097592644@sss.pgh.pa.us>
Permalink:  ../2292.1097592644@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2292.1097592644@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alwin@cs.nl
  Subject: Re: case insensitive table names
  In-Reply-To: <2292.1097592644@sss.pgh.pa.us>

* 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