Re: Case-folding bogosity in new psql

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Case-folding bogosity in new psql
Дата
Msg-id Pine.GSO.4.02A.10001311402110.12762-100000@Hund.DoCS.UU.SE
обсуждение исходный текст
Ответ на Case-folding bogosity in new psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Case-folding bogosity in new psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
This is not a bogosity if you read and understand the psql grammar. Quotes
are for protecting whitespace and other metacharacters. For example, in
6.5 there was no good way to connect (\c) to a database with a space in
the name. psql tries to emulate one of the popular shells in many places,
such as this one.  Furthermore single and double quotes also carry the
same difference as in shells and Perl.

psql is also case sensitive, so \D is not the same as \d, hence
DEFAULT_TBL is not the same as default_tbl.

The conceptual problem I would have with your idea is that command option
interpretation would be inconsistent. For example \e FILE should surely
not cause any lower-casing to happen. Now if I'm supposed to pass on the
identity of the quote character with every option that's read all the way
to the execution phase I'm creating a big hazard. It would furthermore
wash away the above mentioned quoting scheme, because double quotes would
mean one thing to one kind of command, and another thing to another.

I'd agree with your objection if we had a DESCRIBE command or some such,
but the psql grammar is different from SQL, and I think it's good to keep
that clear.

What do other people say about this?


On Sun, 30 Jan 2000, Tom Lane wrote:

> New psql doesn't case-fold in \d command:
> 
> regression=# \d DEFAULT_TBL
> Did not find any relation named "DEFAULT_TBL".
> regression=# \d default_tbl
>           Table "default_tbl"
>  Attribute |  Type   |    Modifier
> ... etc ...
> 
> I'd expect the name of the table to get folded to lower case unless
> I put quotes around it.  That is in fact how 6.5 psql behaves.
> 
>             regards, tom lane
> 
> 

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Another nasty cache problem
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] freefuncs.c is never called from anywhere!?