Re: Case-sensitive connect in psql is perplexing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Case-sensitive connect in psql is perplexing
Дата
Msg-id 616.1234324305@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Case-sensitive connect in psql is perplexing  (Kevin Murphy <murphy@genome.chop.edu>)
Список pgsql-general
Kevin Murphy <murphy@genome.chop.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Kevin Murphy
Дата:
Сообщение: Case-sensitive connect in psql is perplexing
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Referencing Cursor/Row/Record Fields in PL/PgSQL