X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6EF3647580B for ; Mon, 14 Apr 2003 01:43:56 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 9FC75476374 for ; Mon, 14 Apr 2003 01:43:51 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3E5i52L002152; Mon, 14 Apr 2003 01:44:05 -0400 (EDT) To: milimeter@163.com Cc: pgsql-general@postgresql.org Subject: Re: Problem about pgsql's column alias In-reply-to: <200304141316.32163."milimeter@163.com"> References: <200304141316.32163."milimeter@163.com"> Comments: In-reply-to "milimeter@163.com" message dated "Mon, 14 Apr 2003 13:16:32 +0800" Date: Mon, 14 Apr 2003 01:44:05 -0400 Message-ID: <2151.1050299045@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-16.1 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/800 X-Sequence-Number: 40865 "milimeter@163.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