Re: [HACKERS] Case sensitivity in identifiers

Поиск
Список
Период
Сортировка
От John Robinson
Тема Re: [HACKERS] Case sensitivity in identifiers
Дата
Msg-id 27c5f7bd764ac34551acad7ff8f9b9ff
обсуждение исходный текст
Ответ на [HACKERS] Case sensitivity in identifiers  (John Robinson <john@intelligent.co.uk>)
Список pgsql-hackers
Bruce Momjian writes ("Re: [HACKERS] Case sensitivity in identifiers"):
> > Right now saying '\d FOO' says 'Couldn't find table FOO!' so somebody
> > missed a bit of case-sensitivity code somewhere, but I'm sure you see
>
> I will check on this.  Looks like a bug.

Cheers. Incidentally I wish \d tablename wouldn't complain if I stuck
a ; on the end, just because I get in to the habit inside psql, but I
know the ; is only supposed to terminate SQL statements which \d isn't.

> You have a good point here.  I can see a value in keeping case when
> creating fields, but allowing any case to access it.  Is that the basis
> of the argument.

Yes indeed.

> Right now, we lowercase arguments when the come in from the parser.  We
> could preserve case for Create-type statements, and force lowercase on
> all comparisons, but that is a big job, and I think we questioned the
> value of it.

I wouldn't have thought it was a particularly big job; you keep these
identifiers in postgres tables anyway: why not a new batch of char
types and operators using strcasecmp instead of strcmp?

I'm suggesting that's not a big job because if you've structured your
code right (of course you have!) you just copy all the files, do a
spot of search and replace, and possibly some minor tweaking. Maybe
even just two new functions (compare ignoring case - or don't you have
it already?) plus a suite of case-insensitive character operators to
sort out indexing.

Some end users might even find such new functionality useful...

John.                                                         _     _
- --                                                        _  | |___| |_  _ _
John Robinson      46 Bank Street, Dumfries DG1 2PA, UK  | |_| / . \ ' \| ' \
+44 1387 247249     http://www.intelligent.co.uk/~john/   \___/\___/_||_|_||_|
You can waste a whole lifetime just trying to be                   --Chris Rea

------------------------------

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