Re: Case-sensitive connect in psql is perplexing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Murphy <murphy(at)genome(dot)chop(dot)edu>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Case-sensitive connect in psql is perplexing
Date: 2009-02-11 03:51:45
Message-ID: 616.1234324305@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kevin Murphy <murphy(at)genome(dot)chop(dot)edu> writes:
> I've noticed that the argument to the \c (connect) meta-command is
> case-sensitive. This doesn't seem to be consistent with other
> meta-commands or the SQL standard of case-insensitive identifiers.

... however, it's consistent with the behavior of psql's equivalent
command-line arguments, so you're more or less damned if you do and
damned if you don't.

I think the actual original reasoning is explained in the comment in
command.c:

* Ideally we should treat the arguments as SQL identifiers. But for
* backwards compatibility with 7.2 and older pg_dump files, we have to
* take unquoted arguments verbatim (don't downcase them). For now,
* double-quoted arguments may be stripped of double quotes (as if SQL
* identifiers). By 7.4 or so, pg_dump files can be expected to
* double-quote all mixed-case \connect arguments, and then we can get rid
* of OT_SQLIDHACK.

which was presumbly written during the 7.3 development cycle. We had a
shorter time horizon for compatibility considerations back then. I'm
not sure that today, we'd want to blow off old dump files even yet...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2009-02-11 04:21:08 Re: Referencing Cursor/Row/Record Fields in PL/PgSQL
Previous Message Kevin Murphy 2009-02-11 03:24:20 Case-sensitive connect in psql is perplexing