Re: BUG #2204: Feature Req: Unique output column names

From: Brandon Black <blblack(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2204: Feature Req: Unique output column names
Date: 2006-01-24 23:23:21
Message-ID: 84621a60601241523yb467e27ob9fa170b5327175c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 1/24/06, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2006-01-25 02:39:52 Re: BUG #2204: Feature Req: Unique output column names
Previous Message Alvaro Herrera 2006-01-24 22:21:10 Re: BUG #2204: Feature Req: Unique output column names