agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedUnquoted column names fold to lower case
23+ messages / 8 participants
[nested] [flat]
* Unquoted column names fold to lower case
@ 2013-07-03 09:12 Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 09:27 ` Re: Unquoted column names fold to lower case Vik Fearing <vik.fearing@dalibo.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
0 siblings, 2 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 09:12 UTC (permalink / raw)
To: pgsql-sql
Hello,
All unquoted identifiers are assumed by PostgreSQL to be lower case by
default. This means
- SELECT MY_COLUMN FROM my_table
- SELECT my_column FROM my_table
- SELECT my_column as MY_COLUMN FROM my_table
All refer to my_column and has column name in lowercase as my_column.
If the aliases are in upper case and quoted then those are returned in
upper case.
- SELECT my_column as "MY_COLUMN" FROM my_table
Is there any workaround to set the alias columns to be returned as upper
case with adding quotes. Is there any connection level parameter to flip
this behavior?
Thanks in advance!
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 09:27 ` Vik Fearing <vik.fearing@dalibo.com>
2013-07-03 11:25 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 1 reply; 23+ messages in thread
From: Vik Fearing @ 2013-07-03 09:27 UTC (permalink / raw)
To: Dev Kumkar <devdas.kumkar@gmail.com>; pgsql-sql
On 07/03/2013 11:12 AM, Dev Kumkar wrote:
> All unquoted identifiers are assumed by PostgreSQL to be lower case by
> default. This means
> - SELECT MY_COLUMN FROM my_table
> - SELECT my_column FROM my_table
> - SELECT my_column as MY_COLUMN FROM my_table
> All refer to my_column and has column name in lowercase as my_column.
>
> If the aliases are in upper case and quoted then those are returned in
> upper case.
> - SELECT my_column as "MY_COLUMN" FROM my_table
>
> Is there any workaround to set the alias columns to be returned as
> upper case with adding quotes.
There is no workaround because there is no bug.
> Is there any connection level parameter to flip this behavior?
No.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 09:27 ` Re: Unquoted column names fold to lower case Vik Fearing <vik.fearing@dalibo.com>
@ 2013-07-03 11:25 ` Dev Kumkar <devdas.kumkar@gmail.com>
0 siblings, 0 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 11:25 UTC (permalink / raw)
To: Vik Fearing <vik.fearing@dalibo.com>; +Cc: pgsql-sql
Thanks!
Sure this is not a bug. Just want to know if there is any possible way to
achieve this.
Reason being - need to change all the data layer of project where the
column mapping has been done with Upper Case.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 13:41 ` Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
1 sibling, 1 reply; 23+ messages in thread
From: Theodore Petrosky @ 2013-07-03 13:41 UTC (permalink / raw)
To: pgsql-sql@postgresql.org, Dev Kumkar <devdas.kumkar@gmail.com>
sorry, but you misunderstand. this is the correct behavior of SQL.
It is part of the specification to do this.
--- On Wed, 7/3/13, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
> From: Dev Kumkar <devdas.kumkar@gmail.com>
> Subject: [SQL] Unquoted column names fold to lower case
> To: pgsql-sql@postgresql.org
> Date: Wednesday, July 3, 2013, 5:12 AM
> Hello,
>
> All unquoted identifiers are assumed by PostgreSQL to be
> lower case by default. This means
> - SELECT MY_COLUMN FROM my_table
> - SELECT my_column FROM my_table
> - SELECT my_column as MY_COLUMN FROM my_table
>
> All refer to my_column and has column name in lowercase as
> my_column.
>
> If the aliases are in upper case and quoted then
> those are returned in upper case.
> - SELECT my_column as "MY_COLUMN" FROM
> my_table
>
>
> Is there any workaround to set the alias columns
> to be returned as upper case with adding quotes. Is there
> any connection level parameter to flip this behavior?
>
> Thanks in advance!
>
>
> Regards...
>
>
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
@ 2013-07-03 14:16 ` Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 23+ messages in thread
From: Thomas Kellerer @ 2013-07-03 14:16 UTC (permalink / raw)
To: pgsql-sql
Theodore Petrosky, 03.07.2013 15:41:
> sorry, but you misunderstand. this is the correct behavior of SQL.
>
> It is part of the specification to do this.
>
Not quite. The SQL standard requires folding to uppercase.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
@ 2013-07-03 15:24 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
0 siblings, 1 reply; 23+ messages in thread
From: Bruce Momjian @ 2013-07-03 15:24 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-sql
On Wed, Jul 3, 2013 at 04:16:41PM +0200, Thomas Kellerer wrote:
> Theodore Petrosky, 03.07.2013 15:41:
> > sorry, but you misunderstand. this is the correct behavior of SQL.
> >
> > It is part of the specification to do this.
> >
>
> Not quite. The SQL standard requires folding to uppercase.
Agreed. The original poster specifically wanted "MYTABLE" and mytable
to be the same, not "mytable" and mytable. Postgres is certainly
non-standard in this area. I think the ability visiually distinguish
lower-case letters better than upper-case letters has led to our
behavior.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
@ 2013-07-03 15:32 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 15:32 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 8:54 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Agreed. The original poster specifically wanted "MYTABLE" and mytable
> to be the same, not "mytable" and mytable. Postgres is certainly
> non-standard in this area. I think the ability visiually distinguish
> lower-case letters better than upper-case letters has led to our
> behavior.
Not really, actually am looking for column aliases here and not the table.
Here is the example again when the aliases are unquoted:
- SELECT my_column as MY_COLUMN FROM my_table
The above SELECT will fold the alias name as my_column and not MY_COLUMN.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 15:35 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
0 siblings, 1 reply; 23+ messages in thread
From: Bruce Momjian @ 2013-07-03 15:35 UTC (permalink / raw)
To: Dev Kumkar <devdas.kumkar@gmail.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 09:02:20PM +0530, Dev Kumkar wrote:
> On Wed, Jul 3, 2013 at 8:54 PM, Bruce Momjian <bruce@momjian.us> wrote:
>
> Agreed. The original poster specifically wanted "MYTABLE" and mytable
> to be the same, not "mytable" and mytable. Postgres is certainly
> non-standard in this area. I think the ability visiually distinguish
> lower-case letters better than upper-case letters has led to our
> behavior.
>
>
> Not really, actually am looking for column aliases here and not the table. Here
> is the example again when the aliases are unquoted:
> - SELECT my_column as MY_COLUMN FROM my_table
>
> The above SELECT will fold the alias name as my_column and not MY_COLUMN.
Yes, both the identifier names and alias names are folded to lower case.
I never thought of them as different, but you are right, they are, and
we are non-standard in both areas. Sorry.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
@ 2013-07-03 15:50 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 16:20 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 15:50 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 9:05 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Yes, both the identifier names and alias names are folded to lower case.
> I never thought of them as different, but you are right, they are, and
> we are non-standard in both areas. Sorry.
Any plans to fix this in next release or having a patch to fix this?
The default PostgreSQL behavior is folding column names to lower case but
when an alias is used it should fold as per alias name.
Note that adding quotes for aliases will be blessed by PostgreSQL and then
those will be folded to upper case BUT this adds up to lot of changes in
the SQL layer.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 16:05 ` Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 1 reply; 23+ messages in thread
From: Thomas Kellerer @ 2013-07-03 16:05 UTC (permalink / raw)
To: pgsql-sql
Dev Kumkar wrote on 03.07.2013 17:50:
> Note that adding quotes for aliases will be blessed by PostgreSQL and
> then those will be folded to upper case BUT this adds up to lot of
> changes in the SQL layer.
I wonder why you need that. I never had the requirement for that.
Which driver/interface do you use that requires an alias to be all uppercase?
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
@ 2013-07-03 18:46 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 18:46 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-sql
On Wed, Jul 3, 2013 at 9:35 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
> I wonder why you need that. I never had the requirement for that.
>
> Which driver/interface do you use that requires an alias to be all
> uppercase?
Looks like you didn't get me, am not saying aliases to be all upper case by
default (BTW upper case behavior is seen in Oracle by default which is
exactly reverse of postgres).
But what I am asking here is if an alias name is provided be it upper case,
lower case, or a mix then shouldn't it be preserved as as it is given. All
this talk is when alias names are unquoted, when quoted then its standard
behavior as seen in other databases.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 19:08 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:42 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:47 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
2014-05-28 05:47 ` Re: Unquoted column names fold to lower case creechy <mock@fakebelieve.org>
0 siblings, 3 replies; 23+ messages in thread
From: Alvaro Herrera @ 2013-07-03 19:08 UTC (permalink / raw)
To: Dev Kumkar <devdas.kumkar@gmail.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
Dev Kumkar escribió:
> But what I am asking here is if an alias name is provided be it upper case,
> lower case, or a mix then shouldn't it be preserved as as it is given. All
> this talk is when alias names are unquoted, when quoted then its standard
> behavior as seen in other databases.
Aliases are treated just like any other identifier. The downcasing
happens in the lexer (src/backend/parser/scan.l), which is totally
unaware of the context in which this is happening; so there's no way to
tweak the downcasing behavior for only aliases and not other
identifiers.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2013-07-03 19:42 ` Dev Kumkar <devdas.kumkar@gmail.com>
2 siblings, 0 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 19:42 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Thu, Jul 4, 2013 at 12:38 AM, Alvaro Herrera <alvherre@2ndquadrant.com>wrote:
> Aliases are treated just like any other identifier. The downcasing
> happens in the lexer (src/backend/parser/scan.l), which is totally
> unaware of the context in which this is happening; so there's no way to
> tweak the downcasing behavior for only aliases and not other
> identifiers.
>
Oh OK, that makes sense and yes can see through complexity.
So I believe when aliases are quoted then the scan process might be
different and hence quotes aliases TEXT CASE gets preserved.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2013-07-03 19:47 ` Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 20:06 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 21:01 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2 siblings, 2 replies; 23+ messages in thread
From: Tom Lane @ 2013-07-03 19:47 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Dev Kumkar <devdas.kumkar@gmail.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Dev Kumkar escribió:
>> But what I am asking here is if an alias name is provided be it upper case,
>> lower case, or a mix then shouldn't it be preserved as as it is given. All
>> this talk is when alias names are unquoted, when quoted then its standard
>> behavior as seen in other databases.
> Aliases are treated just like any other identifier. The downcasing
> happens in the lexer (src/backend/parser/scan.l), which is totally
> unaware of the context in which this is happening; so there's no way to
> tweak the downcasing behavior for only aliases and not other
> identifiers.
Quite aside from implementation difficulty, restricting the change to
just column aliases doesn't make it more palatable. You'd entirely lose
the argument that the change increases spec compliance, because the spec
is perfectly clear that a column alias is an identifier just like any
other. And you'd still be paying a large part of the application
breakage costs, because the identifiers coming back in query descriptors
are one of the main ways applications would notice such a change.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:47 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
@ 2013-07-03 20:06 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 20:30 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 1 reply; 23+ messages in thread
From: Bruce Momjian @ 2013-07-03 20:06 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Dev Kumkar <devdas.kumkar@gmail.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 03:47:37PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Dev Kumkar escribió:
> >> But what I am asking here is if an alias name is provided be it upper case,
> >> lower case, or a mix then shouldn't it be preserved as as it is given. All
> >> this talk is when alias names are unquoted, when quoted then its standard
> >> behavior as seen in other databases.
>
> > Aliases are treated just like any other identifier. The downcasing
> > happens in the lexer (src/backend/parser/scan.l), which is totally
> > unaware of the context in which this is happening; so there's no way to
> > tweak the downcasing behavior for only aliases and not other
> > identifiers.
>
> Quite aside from implementation difficulty, restricting the change to
> just column aliases doesn't make it more palatable. You'd entirely lose
> the argument that the change increases spec compliance, because the spec
> is perfectly clear that a column alias is an identifier just like any
> other. And you'd still be paying a large part of the application
> breakage costs, because the identifiers coming back in query descriptors
> are one of the main ways applications would notice such a change.
And let's not forget that column aliases can be used as indentifiers in
queries:
test=> SELECT 1 AS x
test-> ORDER BY x;
x
---
1
(1 row)
test=> SELECT 1 AS "X"
ORDER BY x;
ERROR: column "x" does not exist
LINE 2: ORDER BY x;
Changing this would mean that the same identifier would have different
case-folding rules depending on where it appeared in the query.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:47 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 20:06 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
@ 2013-07-03 20:30 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 23:29 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 20:30 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Thu, Jul 4, 2013 at 1:36 AM, Bruce Momjian <bruce@momjian.us> wrote:
> And let's not forget that column aliases can be used as indentifiers in
> queries:
>
> test=> SELECT 1 AS x
> test-> ORDER BY x;
> x
> ---
> 1
> (1 row)
>
> test=> SELECT 1 AS "X"
> ORDER BY x;
> ERROR: column "x" does not exist
> LINE 2: ORDER BY x;
>
> Changing this would mean that the same identifier would have different
> case-folding rules depending on where it appeared in the query.
Sorry but I am not sure about your point here. Currently if the alias is
quoted then same needs to be used in queries as identifies:
SELECT 1 AS "X"
ORDER BY "X";
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:47 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 20:06 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 20:30 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 23:29 ` Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 23+ messages in thread
From: Bruce Momjian @ 2013-07-03 23:29 UTC (permalink / raw)
To: Dev Kumkar <devdas.kumkar@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Thu, Jul 4, 2013 at 02:00:24AM +0530, Dev Kumkar wrote:
> On Thu, Jul 4, 2013 at 1:36 AM, Bruce Momjian <bruce@momjian.us> wrote:
>
> And let's not forget that column aliases can be used as indentifiers in
> queries:
>
> test=> SELECT 1 AS x
> test-> ORDER BY x;
> x
> ---
> 1
> (1 row)
>
> test=> SELECT 1 AS "X"
> ORDER BY x;
> ERROR: column "x" does not exist
> LINE 2: ORDER BY x;
>
> Changing this would mean that the same identifier would have different
> case-folding rules depending on where it appeared in the query.
>
>
> Sorry but I am not sure about your point here. Currently if the alias is quoted
> then same needs to be used in queries as identifies:
> SELECT 1 AS "X"
> ORDER BY "X";
You would need to double-quote 'x' in the ORDER BY, but not in the
target list (because case would be preserved there) --- that is
confusing.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:47 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
@ 2013-07-03 21:01 ` Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 0 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 21:01 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Thu, Jul 4, 2013 at 1:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Quite aside from implementation difficulty, restricting the change to
> just column aliases doesn't make it more palatable. You'd entirely lose
> the argument that the change increases spec compliance, because the spec
> is perfectly clear that a column alias is an identifier just like any
> other. And you'd still be paying a large part of the application
> breakage costs, because the identifiers coming back in query descriptors
> are one of the main ways applications would notice such a change.
True, applications will notice and map only the identifiers coming back in
query descriptor and in cases when the application reading these resultsets
is case-sensitive for descriptors then breakage cost will be there. Hence
was all this discussion to reduce the application breakage cost in
particular cases.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Re: Unquoted column names fold to lower case Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2014-05-28 05:47 ` creechy <mock@fakebelieve.org>
2 siblings, 0 replies; 23+ messages in thread
From: creechy @ 2014-05-28 05:47 UTC (permalink / raw)
To: pgsql-sql
Alvaro Herrera-9 wrote
> Dev Kumkar escribió:
>
> Aliases are treated just like any other identifier. The downcasing
> happens in the lexer (src/backend/parser/scan.l), which is totally
> unaware of the context in which this is happening; so there's no way to
> tweak the downcasing behavior for only aliases and not other
> identifiers.
Hi, sorry I know this is an old thread, but I'm running up against the same
issue.
This statement seems to contradict the PostgreSQL documentation regarding
identifiers. From "4.1.1. Identifiers and Key Words" in
http://www.postgresql.org/docs/8.0/static/sql-syntax.html it states
"Quoting an identifier also makes it case-sensitive, whereas unquoted names
are always folded to lower case. For example, the identifiers FOO, foo, and
"foo" are considered the same by PostgreSQL, but "Foo" and "FOO" are
different from these three and each other."
But your statement suggests that even though aliases are treated like any
other identifier, and you can quote an identifier to make it case sensitive,
this is not happening. To me this sounds like a bug.
Thoughts?
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Unquoted-column-names-fold-to-lower-case-tp5762315p5805199.h...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
@ 2013-07-03 16:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 16:27 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 18:49 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 2 replies; 23+ messages in thread
From: Tom Lane @ 2013-07-03 16:20 UTC (permalink / raw)
To: Dev Kumkar <devdas.kumkar@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
Dev Kumkar <devdas.kumkar@gmail.com> writes:
> Any plans to fix this in next release or having a patch to fix this?
No.
This has been discussed (many times) before. There isn't any feasible
way to change this behavior without breaking an incredible amount of
code, much of which isn't even under our control. The marginal increase
in standards compliance is not worth the pain --- especially when the
aspect of the standard in question isn't even one that most of us like.
(All-upper-case is hard to read.)
If this is a deal-breaker for you, then I'm sorry, but you need to find
another database. Postgres settled on this behavior fifteen years ago,
and we're not changing it now.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:20 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
@ 2013-07-03 16:27 ` Bruce Momjian <bruce@momjian.us>
1 sibling, 0 replies; 23+ messages in thread
From: Bruce Momjian @ 2013-07-03 16:27 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dev Kumkar <devdas.kumkar@gmail.com>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 12:20:06PM -0400, Tom Lane wrote:
> Dev Kumkar <devdas.kumkar@gmail.com> writes:
> > Any plans to fix this in next release or having a patch to fix this?
>
> No.
>
> This has been discussed (many times) before. There isn't any feasible
> way to change this behavior without breaking an incredible amount of
> code, much of which isn't even under our control. The marginal increase
> in standards compliance is not worth the pain --- especially when the
> aspect of the standard in question isn't even one that most of us like.
> (All-upper-case is hard to read.)
>
> If this is a deal-breaker for you, then I'm sorry, but you need to find
> another database. Postgres settled on this behavior fifteen years ago,
> and we're not changing it now.
Agreed. I guess we could add it to the "Features We Do Not Want"
section of the TODO list, but it rarely comes up.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Re: Unquoted column names fold to lower case Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Re: Unquoted column names fold to lower case Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Re: Unquoted column names fold to lower case Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:20 ` Re: Unquoted column names fold to lower case Tom Lane <tgl@sss.pgh.pa.us>
@ 2013-07-03 18:49 ` Dev Kumkar <devdas.kumkar@gmail.com>
1 sibling, 0 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 18:49 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <bruce@momjian.us>; Thomas Kellerer <spam_eater@gmx.net>; pgsql-sql
On Wed, Jul 3, 2013 at 9:50 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Any plans to fix this in next release or having a patch to fix this?
>
> No.
>
> This has been discussed (many times) before. There isn't any feasible
> way to change this behavior without breaking an incredible amount of
> code, much of which isn't even under our control. The marginal increase
> in standards compliance is not worth the pain --- especially when the
> aspect of the standard in question isn't even one that most of us like.
> (All-upper-case is hard to read.)
>
> If this is a deal-breaker for you, then I'm sorry, but you need to find
> another database. Postgres settled on this behavior fifteen years ago,
> and we're not changing it now.
>
Again my question was not to change the default behavior and make then
All-upper-case as there is no need to change it.
Rather it was for alias names and if those are with upper case or mix case
then wouldn't it will be good to preserve same. For me these changes to
have aliases quoted are manageable and I was just checking for any thoughts
here.
Regards...
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Unquoted column names fold to lower case
@ 2013-07-03 09:16 Dev Kumkar <devdas.kumkar@gmail.com>
0 siblings, 0 replies; 23+ messages in thread
From: Dev Kumkar @ 2013-07-03 09:16 UTC (permalink / raw)
To: pgsql-sql
Resending
On Wed, Jul 3, 2013 at 2:42 PM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
> Hello,
>
> All unquoted identifiers are assumed by PostgreSQL to be lower case by
> default. This means
> - SELECT MY_COLUMN FROM my_table
> - SELECT my_column FROM my_table
> - SELECT my_column as MY_COLUMN FROM my_table
> All refer to my_column and has column name in lowercase as my_column.
>
> If the aliases are in upper case and quoted then those are returned in
> upper case.
> - SELECT my_column as "MY_COLUMN" FROM my_table
>
> Is there any workaround to set the alias columns to be returned as upper
> case without adding quotes. Is there any connection level parameter to flip
> this behavior?
>
> Thanks in advance!
>
> Regards...
>
^ permalink raw reply [nested|flat] 23+ messages in thread
end of thread, other threads:[~2014-05-28 05:47 UTC | newest]
Thread overview: 23+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03 09:12 Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 09:27 ` Vik Fearing <vik.fearing@dalibo.com>
2013-07-03 11:25 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 13:41 ` Theodore Petrosky <tedpet5@yahoo.com>
2013-07-03 14:16 ` Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 15:24 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 15:32 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 15:35 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 15:50 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 16:05 ` Thomas Kellerer <spam_eater@gmx.net>
2013-07-03 18:46 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:08 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2013-07-03 19:42 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 19:47 ` Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 20:06 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 20:30 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 23:29 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 21:01 ` Dev Kumkar <devdas.kumkar@gmail.com>
2014-05-28 05:47 ` creechy <mock@fakebelieve.org>
2013-07-03 16:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2013-07-03 16:27 ` Bruce Momjian <bruce@momjian.us>
2013-07-03 18:49 ` Dev Kumkar <devdas.kumkar@gmail.com>
2013-07-03 09:16 Re: Unquoted column names fold to lower case Dev Kumkar <devdas.kumkar@gmail.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox