Thread: BUG #11596: Duplicate column

BUG #11596: Duplicate column

From
kotadiyadhrupesh@gmail.com
Date:
The following bug has been logged on the website:

Bug reference:      11596
Logged by:          Dhrupesh
Email address:      kotadiyadhrupesh@gmail.com
PostgreSQL version: 9.1.14
Operating system:   UBUNTU 12.04
Description:

Hello,

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.

Like,select id,ID from table

Both column return same data


Thanks,
Dhrupesh

Re: BUG #11596: Duplicate column

From
Marti Raudsepp
Date:
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