Re: BUG #4037: Manual bug: 2.5. Querying a Table - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4037: Manual bug: 2.5. Querying a Table
Date
Msg-id 27448.1205536084@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4037: Manual bug: 2.5. Querying a Table  ("Daniel Cristian Cruz" <danielcristian@gmail.com>)
Responses Re: BUG #4037: Manual bug: 2.5. Querying a Table  ("Daniel Cristian Cruz" <danielcristian@gmail.com>)
List pgsql-bugs
"Daniel Cristian Cruz" <danielcristian@gmail.com> writes:
> Where it says:

> "Notice how the AS clause is used to relabel the output column. (The AS
> clause is optional.)"

> It's wrong, because it causes an error if executed without it.

Hmm?  You can leave off the AS clause if you want:

SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
SELECT city, (temp_hi+temp_lo)/2, date FROM weather;

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Daniel Cristian Cruz"
Date:
Subject: BUG #4037: Manual bug: 2.5. Querying a Table
Next
From: "Alexey"
Date:
Subject: BUG #4038: Problem with locale changing by initdb