AW: Repost: Get table/field-identifiers in uppercase

Поиск
Список
Период
Сортировка
Искать

AW: Repost: Get table/field-identifiers in uppercase

От:
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
Дата:

> When a new table or field is created without quotes, it is assumed to be
> case-insensitive. Herefore I have some questions:
> 
> - Is it SQL-92-conform to handle >"test"< like >test< without quotes, or
> shouldn't it be >test< forced to lowercase?

I do not understand this question. If you want case sensitivity, you need
to quote your identifiers. Unquoted identifiers are case insensitive.
I do not think the standard states what should happen when you start mixing 
quoted and unquoted identifiers for the same object.

> 
> - Oracle returns this no_matter_what-case_it_is-fields with
> uppercase-letters. Is it possible for Postgresql, to imitate this behaviour?

No. PostgreSQL stores them in all lower case (Informix also).

> 
> - How is the handling of case-sensitivity handled in the system-catalogs? Is
> ther any flag or depends it on the name of the object only?

The unquoted identifier is converted to all lower case, no flag.
The quoted identifier is taken as is. 

Andreas

Re: AW: Repost: Get table/field-identifiers in uppercase

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Zeugswetter Andreas SB   writes:
> I do not think the standard states what should happen when you start mixing 
> quoted and unquoted identifiers for the same object.

Actually, it does:
        13)A  and a  are equiva-           lent if the  of the  (with           every letter that is a lower-case letter replaced by the equiva-           lent upper-case letter or letters) and the  of the  (with all occurrences of            replaced by  and all occurrences of  replaced by ), considered as           the repetition of a  that specifies a            of SQL_TEXT and an implementation-           defined collation that is sensitive to case, compare equally           according to the comparison rules in Subclause 8.2, "".

The spec expects unquoted identifiers to be made case-insensitive by
folding them to upper case.  We do it by folding to lower case, instead.
While this isn't 100% standard, it's unlikely to be changed.  Too many
applications would break...
		regards, tom lane

Re: Repost: Get table/field-identifiers in uppercase

От:
Klaus Reger <K.Reger@wwwdb.org>
Дата:
On Tuesday, 10. July 2001 11:45, you wrote:
> > When a new table or field is created without quotes, it is assumed to be
> > case-insensitive. Herefore I have some questions:
> >
> > - Is it SQL-92-conform to handle >"test"< like >test< without quotes, or
> > shouldn't it be >test< forced to lowercase?
>
> I do not understand this question. If you want case sensitivity, you need
> to quote your identifiers. Unquoted identifiers are case insensitive.
> I do not think the standard states what should happen when you start mixing
> quoted and unquoted identifiers for the same object.

OK, lets assume I want the field test explicitly in lowercase (and ONLY in 
lowercase). I can see no way to make this with the current implementation.

By the way in Oracle, we have the same problem, but everything is in 
uppercase.

Regards & thanks

Klaus

-- 
Visit WWWdb at
http://wwwdb.org

FAQ