Skip site navigation (1) Skip section navigation (2)

BUG #2204: Feature Req: Unique output column names

From: "Brandon Black" <blblack(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2204: Feature Req: Unique output column names
Date: 2006-01-23 17:34:27
Message-ID: 20060123173427.08006F0A2F@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2204
Logged by:          Brandon Black
Email address:      blblack(at)gmail(dot)com
PostgreSQL version: All
Operating system:   All
Description:        Feature Req: Unique output column names
Details: 

-------------Example------------

Welcome to psql 8.0.4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

blah=# create table foo (x integer, y integer);
CREATE TABLE
blah=# select count(x), count(y) from foo;
 count | count
-------+-------
     0 |     0
(1 row)

--------------------------------------

Would it be reasonable or possible to have these default output column names
be something unique?  count_x and count_y, or "1", "2"?  Or even name them
literall "count(x)" and "count(y)".  As long as there were some reasonable
convention which doesn't cause conflicting duplicate names...

I realize this is fixable by the user with "AS count_x", this is more an
issue that came in writing cross-vendor ORM modules in perl, where most
other database vendors offer some sort of unique naming convention, but
postgres' output column names are indistinguishable, for the same query.

-- Brandon

Responses

pgsql-bugs by date

Next:From: Michael FuhrDate: 2006-01-23 17:37:45
Subject: Re: BUG #2198: Now returns always same date and time during a session
Previous:From: Tom LaneDate: 2006-01-23 17:29:13
Subject: Re: BUG #2198: Now returns always same date and time during a session

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group