Re: Case-folding bogosity in new psql

From: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Case-folding bogosity in new psql
Date: 2000-01-31 13:14:11
Message-ID: Pine.GSO.4.02A.10001311402110.12762-100000@Hund.DoCS.UU.SE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jose Soares 2000-01-31 13:29:04 Re: [GENERAL] float4 confused as int??
Previous Message Peter Eisentraut 2000-01-31 12:57:48 Re: [HACKERS] Another nasty cache problem