Re: BUG #11596: Duplicate column - Mailing list pgsql-bugs

From Marti Raudsepp
Subject Re: BUG #11596: Duplicate column
Date
Msg-id CABRT9RD8x4Vj1iOTzSpPFTBEf_p1ngEkaDm1CHASE=8yzdR+Qg@mail.gmail.com
Whole thread Raw
In response to BUG #11596: Duplicate column  (kotadiyadhrupesh@gmail.com)
List pgsql-bugs
Hi Dhrupesh,

On Mon, Oct 6, 2014 at 1:58 PM,  <kotadiyadhrupesh@gmail.com> wrote:
> I have one table which have two field
> one is id and other is ID.
> When i featch id then it return always id's
> data.

This is not a bug. Identifiers in the SQL language are
case-insensitive, id and ID refer to the exact same column. In
PostgreSQL's case they are both converted to lower case.

If you want to use uppercase identifiers, you have to quote them using
double quotes:
  select id, "ID" from table;

In general, PostgreSQL community discourages using uppercase letters
anywhere in identifiers.

Regards,
Marti

pgsql-bugs by date:

Previous
From: kotadiyadhrupesh@gmail.com
Date:
Subject: BUG #11596: Duplicate column
Next
From: Tom Lane
Date:
Subject: Re: BUG #11595: PostgreSQL applies intermediate configuration files