pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [SQL] id and ID in CREATE TABLE
Date: Fri, 19 Jul 2002 16:16:53 -0400
Message-ID: <15001.1027109813@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0207191318230.3990-100000@css120.ihs.com>
References: <Pine.LNX.4.44.0207191318230.3990-100000@css120.ihs.com>

"scott.marlowe" <scott.marlowe@ihs.com> writes:
> Plus the pg_class stuff is kind of a blind ally.  If we're looking at 
> foldtoupper as a setting, then we're already admitting that we're doing it 
> to be interchangable with other dbmses. If that's the case, no one is 
> gonna be accessing the pg_* tables, because you wouldn't do that in an app 
> you're writing to be portable.

<< thinks about that for awhile >>

Hmm.  If we are willing to stipulate that the system catalogs stay named
as they are (lower case always), then we could indeed have a runtime
parameter (GUC setting) that controls how individual sessions fold case.
People who need to access the system catalogs regardless can just
double-quote their names.

One fly in the ointment is that we are planning to add the standard's
INFORMATION_SCHEMA views someday, and neither choice of case is going to
be good for them if we have an option like this floating around.  Not
sure what to do about that, although I suppose one way out is to provide
two duplicate sets of those views (one named all-upper-case, the other
all-lower).

I think your four-way proposal is gilding a dead lily, though.  Let's
just do the historical (downcase) and spec-compatible (upcase) options.
Anything else will just create more confusion, IMHO.  The
case-insensitive option is a particularly *bad* idea.

Note it would be a real good idea to fix psql and pg_dump to
double-quote their references to system catalogs, so they don't go
belly-up if invoked on a database where FOLDTOUPPER is true.
(pg_dump could alternatively do SET FOLDTOUPPER = false, but this won't
fly for psql.)

> Leave the system catalogs in lower case, and don't fold calls to anything 
> that's a system catalog.

And you will determine that how, exactly, when you don't know what the
identifier (that you haven't parsed yet) refers to?

Keep it simple, or you'll make things far worse than they are now.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <15001.1027109813@sss.pgh.pa.us>
Permalink:  ../15001.1027109813@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15001.1027109813@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, scott.marlowe@ihs.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] id and ID in CREATE TABLE
  In-Reply-To: <15001.1027109813@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