pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ)
3+ messages / 3 participants
[nested] [flat]

* BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ)
@ 2018-11-22 16:27 PG Bug reporting form <noreply@postgresql.org>
  2018-11-22 17:01 ` Re: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Bug reporting form @ 2018-11-22 16:27 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: fcaa@tragsa.es

The following bug has been logged on the website:

Bug reference:      15516
Logged by:          Paco Calvo
Email address:      fcaa@tragsa.es
PostgreSQL version: 9.5.15
Operating system:   MS Windows Server 2012 R2
Description:        

Hi list,

When using an identifier not quoted which includes an uppercase letter
(Spanish Ñ, Unicode U+00D1), it doesn't get transformed to lowercase (ñ,
Unicode U+00F1) as expected. For instance, using a database with UTF-8
encoding and both LC_COLLATE and LC_CTYPE as 'Spanish_Spain.1252', the
following sentence which uses 2 identifiers with a Ñ uppercase letter

  CREATE TABLE AÑO (CaÑo integer)

creates the table maintaining both Ñ letters as uppercase and forcing to
quote both identifiers as

  CREATE TABLE "aÑo" ("caÑo" integer)

instead of all lowercase and no quoting as expected

  CREATE TABLE año (caño integer)

This quirk in lowercasing identifiers forces to use a different, quoted
identifier or manually change afterwards every identifier.

NB: Reproduced also with PostgreSQL 9.6.9 on MS Windows Server 2012 R2 and
PostgreSQL 11.1 on MS Windows Server 2008 R2. Waiting to test it under Linux
and MacOS.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ)
  2018-11-22 16:27 BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) PG Bug reporting form <noreply@postgresql.org>
@ 2018-11-22 17:01 ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-11-23 09:04   `  RE: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) Calvo Arias, Francisco <fcaa@tragsa.es>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-11-22 17:01 UTC (permalink / raw)
  To: fcaa@tragsa.es; +Cc: pgsql-bugs@lists.postgresql.org

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> When using an identifier not quoted which includes an uppercase letter
> (Spanish Ñ, Unicode U+00D1), it doesn't get transformed to lowercase (ñ,
> Unicode U+00F1) as expected.

PG's downcasing transform is only applied to single-byte characters.
So Ñ could be transformed in LATIN1 encoding, but not UTF8.  There are
various practical reasons why this is unlikely to change soon.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

*  RE: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ)
  2018-11-22 16:27 BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) PG Bug reporting form <noreply@postgresql.org>
  2018-11-22 17:01 ` Re: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-11-23 09:04   ` Calvo Arias, Francisco <fcaa@tragsa.es>
  0 siblings, 0 replies; 3+ messages in thread

From: Calvo Arias, Francisco @ 2018-11-23 09:04 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Thank you very much for your clarification, Tom. (Also, I'm very sorry for not ending and signing my previous message properly. Shame on me, having being Thanksgivig Day!)

I think I'll submit a correction mentioning that ("PG's downcasing transform is only applied to single-byte characters") for last paragraph on "4.1.1. Identifiers and Key Words" in the documentation which states:
- "[...] unquoted names are always folded to lower case"
- "If you want to write portable applications you are advised to always quote a particular name or never quote it"

Regards,
Paco Calvo

-----Mensaje original-----
De: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Enviado el: jueves, 22 de noviembre de 2018 18:02
Para: Calvo Arias, Francisco <fcaa@tragsa.es>
CC: pgsql-bugs@lists.postgresql.org
Asunto: Re: BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ)

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> When using an identifier not quoted which includes an uppercase letter 
> (Spanish Ñ, Unicode U+00D1), it doesn't get transformed to lowercase 
> (ñ, Unicode U+00F1) as expected.

PG's downcasing transform is only applied to single-byte characters.
So Ñ could be transformed in LATIN1 encoding, but not UTF8.  There are various practical reasons why this is unlikely to change soon.

			regards, tom lane


********************************************************************************************** 
El consumo de papel es perjudicial para el medio ambiente. Por favor, téngalo en cuenta antes de imprimir este mensaje. AVISO LEGAL: Este mensaje y sus anexos pueden contener información confidencial o legalmente protegida. Está dirigido únicamente a la persona o entidad indicada como destinatarios del mensaje. Si este mensaje le hubiera llegado por error, por favor elimínelo sin revisarlo ni reenviarlo y notifíquelo inmediatamente al remitente. ********************************************************************************************** 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-11-23 09:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 16:27 BUG #15516: Identifier not quoted with uppercase letter (spanish Ñ) doesn't get transformed to lowercase (ñ) PG Bug reporting form <noreply@postgresql.org>
2018-11-22 17:01 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-11-23 09:04   ` Calvo Arias, Francisco <fcaa@tragsa.es>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox