Re: [HACKERS] Case Preservation disregarding case

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Case Preservation disregarding case
Дата
Msg-id 14059.1162363105@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Case Preservation disregarding case sensitivity?  (beau hargis <beauh@bluefrogmobile.com>)
Список pgsql-sql
"Chuck McDevitt" <cmcdevitt@greenplum.com> writes:
> Equivalent, yes.  But I can interpret that clause it mean I can show
> either the case folded or non-case-folded value in the information
> schema, as they are equivalent.

Well, that's an interesting bit of specs-lawyering, but I don't see
how you can defend it against these rules in SQL99 5.2:
       21) For every <identifier body> IB there is exactly one           corresponding case-normal form CNF. CNF is an
<identifierbody>           derived from IB as follows.
 
           Let n be the number of characters in IB. For i ranging from 1           (one) to n, the i-th character M(i)
ofIB is translated into the           corresponding character or characters of CNF as follows.
 
           Case:
           a) If M(i) is a lower case character or a title case character             for which an equivalent upper
casesequence U is defined by             Unicode, then let j be the number of characters in U; the             next j
charactersof CNF are U.
 
           b) Otherwise, the next character of CNF is M(i).
       22) The case-normal form of the <identifier body> of a <regular           identifier> is used for purposes such
asand including           determination of identifier equivalence, representation in           the Definition and
InformationSchemas, and representation in           diagnostics areas.
 
           NOTE 44 - Any lower-case letters for which there are no upper-           case equivalents are left in their
lower-caseform.
 

Again, obviously we are not compliant because we fold to lower rather
than upper case, but I do not see how you can read (22) as not requiring
the information schema to show the upper-cased form.  The output of
functions such as PQfname() might be considered closer to diagnostics
info than information schema, but that's covered too.

But the really serious problem with what you propose is that it would
allow two table columns with names that the system considers distinct
to show as the same string in the information schema and diagnostic
outputs.  That can't be acceptable --- it's going to break any
application that does any nontrivial analysis of what it sees there,
not to mention that it violates various primary key constraints in
the information schema specification.
        regards, tom lane


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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Add calculated fields from one table to other table
Следующее
От: roopa perumalraja
Дата:
Сообщение: Re: Add calculated fields from one table to other table