Re: Problem about pgsql's column alias

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: milimeter(at)163(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem about pgsql's column alias
Date: 2003-04-14 05:44:05
Message-ID: 2151.1050299045@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-interfaces pgsql-jdbc

"milimeter(at)163(dot)com" <milimeter(at)163(dot)com> writes:
> I found that in postgresql, we can only use "select login_name as name from
> users;" to get an alias "name" for column "login_name", but in most other
> databases we can omit the "as", that is "select login_name name from users;".

AS is not optional in Postgres, and will never be so unless we choose to
drop support for postfix operators, which I consider an unlikely choice.
Example: in
SELECT foo ! bar;
is the "!" an infix operator, or is it postfix with the intended meaning
SELECT (foo!) AS bar;

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Kenny 2003-04-14 09:37:32 Downloadable Version
Previous Message Weiping He 2003-04-14 05:42:49 Encoding conversion problem in AIX 4.3.3?

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2003-04-14 07:19:54 Re: Anyone working on better transaction locking?
Previous Message milimeter@163.com 2003-04-14 05:16:32 Problem about pgsql's column alias

Browse pgsql-interfaces by date

  From Date Subject
Next Message email lists 2003-04-14 09:23:10 plpython module loading errors
Previous Message milimeter@163.com 2003-04-14 05:16:32 Problem about pgsql's column alias

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alexey Yudichev 2003-04-14 06:29:59 unterminated quoted string
Previous Message milimeter@163.com 2003-04-14 05:16:32 Problem about pgsql's column alias