Re: BUG #2204: Feature Req: Unique output column names - Mailing list pgsql-bugs

From Brandon Black
Subject Re: BUG #2204: Feature Req: Unique output column names
Date
Msg-id 84621a60601241523yb467e27ob9fa170b5327175c@mail.gmail.com
Whole thread Raw
In response to Re: BUG #2204: Feature Req: Unique output column names  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs
On 1/24/06, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> Tom Lane wrote:
>
> > I haven't looked at SQL99 or SQL2003, but most likely they say the same
> > thing in two or three times as many words ;-)
>
> Thanks for the pointer.  In SQL 2003, this is 7.12
> <query specification>:
>
> 17) Case:
> a) If the i-th <derived column> in the <select list> specifies an
>    <as clause> that contains a <column name> CN, then the <column name>
>    of the i-th column of the result is CN.
> b) If the i-th <derived column> in the <select list> does not specify an
>    <as clause> and the <value expression> of that <derived column> is a
>    single column reference, then the <column name> of the i-th column of
>    the result is the <column name> of the column designated by the
>    column reference.
> c) Otherwise, the <column name> of the i-th column of the <query
>    specification> is implementation dependent.
>
> So they actually simplified the third rule and we comply with it!
>
>
> It would be nice to have this text in HTML or info format.  This PDF
> mess is really awkward.

Well, then the current behavior is kosher in SQL2003 then, but not
neccesarily for SQL92 if someone decided to define some literal column
names like "count" or "sum" :)

It's not a big deal, just seemed that in certain situations the way
other vendors have done it ( "count(x)", "count(y)"  ... or .. "1",
"2") at least avoid duplication in common cases.

-- Brandon

pgsql-bugs by date:

Previous
From: "Fahri CAKIROGLU"
Date:
Subject: BUG #2209: Low performan on consecutive selects
Next
From: "Pramod Kudva"
Date:
Subject: BUG #2207: PG Database Server 8.1 Service doesnt start