Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8v7h-0003oy-V4 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Feb 2013 16:05:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U8v7g-0004Lq-PK for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Feb 2013 16:05:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8hmZ-0000iY-Mh for pgsql-bugs@postgresql.org; Fri, 22 Feb 2013 01:50:39 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8hmU-0003Be-WB for pgsql-bugs@postgresql.org; Fri, 22 Feb 2013 01:50:39 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8hmS-00038Y-St for pgsql-bugs@postgresql.org; Fri, 22 Feb 2013 01:50:34 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1U8hmS-0003w9-LN for pgsql-bugs@postgresql.org; Fri, 22 Feb 2013 01:50:32 +0000 Date: Fri, 22 Feb 2013 01:50:32 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7899: allow key word as alias in subquery but Can't reference it in outer query To: pgsql-bugs@postgresql.org From: amutu@amutu.com X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 7899 Logged by: jov Email address: amutu@amutu.com PostgreSQL version: 9.1.3 Operating system: CentOS 6 Description:=20=20=20=20=20=20=20=20 xxx=3D# select 2 from (select 1 as end) t;=20=20=20 ?column?=20 ---------- 2 (1 row) xxx=3D# select end from (select 1 as end) t; ERROR: syntax error at or near "end" LINE 1: select end from (select 1 as end) t; ^ xxx=3D# select version();=20=20 version=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 =20=20 ---------------------------------------------------------------------------= --------------------------------- -- PostgreSQL 9.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6), 64-bi t (1 row) I think use key word as alias should get a error message such as $key_word is Key Word,should not be used as identifier bla bla,so for some complex query error user can save a lot of time.=20 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs