Thread: reference to 'as' field

reference to 'as' field

From
Frank Bax
Date:
When I use "select (f1+f2+f3+f4+f5) as f0 ..." in 7.4.3, it seems I can use
"f0" is "order by", but not "where" clause [column 'f0' does not
exist]?  Does this change in more current versions?  Is there a list of
which clauses support this syntax in which versions?


Debian PostgreSQL Install

From
Date:
this weekend will be my (linux newbie) first foray
into trying to install LAPP Linux/Apache/PHP/PGSQL.

i'm using a pii 400 MHz box, so i decided to check out
the linux "light" distros.  i decided to go with darn
small linux (a debian based, 50mb version of linux) as
my first trial OS.

i want to make sure i have the big picture down...

1. learn a little about apt-get.
2. download PGSQL, Apache and PHP.
3. install PGSQL.
4. install Apache.
5. install PHP.
6. make sure everything is configured correctly (this
might be done during the install procedures, i'll have
to follow instructions).

i've done a little research and it seems i will have
to build PGSQL from source.  i haven't found a PGSQL
8.03 debian binary yet.  the latest i found was 7.4.7.

the postgres site seems to only have rpms.  if and
when i ever get a true production server up, i'll use
redhat - so it is nice to see the latest and greatest
PGSQL version in RPM format, but it doesn't help me
now.

Any good tutorial links, advice or tips would be much
appreciated.

tia...



__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

Re: reference to 'as' field

From
Michael Fuhr
Date:
On Thu, Sep 01, 2005 at 11:11:59AM -0400, Frank Bax wrote:
>
> When I use "select (f1+f2+f3+f4+f5) as f0 ..." in 7.4.3, it seems I can use
> "f0" is "order by", but not "where" clause [column 'f0' does not
> exist]?  Does this change in more current versions?  Is there a list of
> which clauses support this syntax in which versions?

Here's an excerpt from the SELECT documentation for 8.0 (8.1beta
says the same thing):

"Using the clause AS output_name, another name can be specified for
an output column.  This name is primarily used to label the column
for display.  It can also be used to refer to the column's value
in ORDER BY and GROUP BY clauses, but not in the WHERE or HAVING
clauses; there you must write out the expression instead."

http://www.postgresql.org/docs/8.0/static/sql-select.html

--
Michael Fuhr

Re: Debian PostgreSQL Install

From
David
Date:
On Thu, Sep 01, 2005 at 09:40:22AM -0700, operationsengineer1@yahoo.com wrote:
> this weekend will be my (linux newbie) first foray
> into trying to install LAPP Linux/Apache/PHP/PGSQL.
>
> i'm using a pii 400 MHz box, so i decided to check out
> the linux "light" distros.  i decided to go with darn
> small linux (a debian based, 50mb version of linux) as
> my first trial OS.

I'm not familiar with the distro to which you refer, but I'll speak in
reference to what I know about Debian.

It might take a bit more effort, but I'm thinking that you might be
better off to use the "real" debian distro.  I believe you can start
with a ~ 100-Meg CD iso download and install a base system and then
download and install whatever else you want.

(See further details below).

> i want to make sure i have the big picture down...
>
> 1. learn a little about apt-get.
> 2. download PGSQL, Apache and PHP.
> 3. install PGSQL.
> 4. install Apache.
> 5. install PHP.
> 6. make sure everything is configured correctly (this
> might be done during the install procedures, i'll have
> to follow instructions).
>
> i've done a little research and it seems i will have
> to build PGSQL from source.  i haven't found a PGSQL
> 8.03 debian binary yet.  the latest i found was 7.4.7.

8.0.3 _is_ available in the testing, or the unstable branches.  I am
currently running the "stable" branch, in which, as you said, 7.4.7 is
the latest (and anything later will undoubtedly never be available
there).  But I included the "testing" branch in my apt sources.list, and
installed 8.0.3  (it's packaged as "postgresql-8.0" instead of
"postgresql").

Since this is not a Debian list, I'll stop with the Debian details on
that.  If you have any further questions related to apt-get or details
about the Debian system, please feel free to email me privately.  I'm no
guru on the top by any means, but I'll answer as best I can.

Re: Debian PostgreSQL Install

From
Bruno Wolff III
Date:
Please don't reply to list messages to start new threads. This messes up
the archives and could result in people missing your question.

> i've done a little research and it seems i will have
> to build PGSQL from source.  i haven't found a PGSQL
> 8.03 debian binary yet.  the latest i found was 7.4.7.

Iy you are playing around and are building from source anyway, you might be
better off playing with the 8.1 beta.