X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 214D2475A45 for ; Thu, 13 Feb 2003 18:02:43 -0500 (EST) Received: from email03.aon.at (WARSL402PIP6.highway.telekom.at [195.3.96.93]) by postgresql.org (Postfix) with SMTP id 408CE475A37 for ; Thu, 13 Feb 2003 18:02:42 -0500 (EST) Received: (qmail 105722 invoked from network); 13 Feb 2003 23:02:43 -0000 Received: from m154p007.dipool.highway.telekom.at (HELO cantor) ([62.46.9.39]) (envelope-sender ) by qmail3rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 13 Feb 2003 23:02:43 -0000 From: Manfred Koizar To: Dmitry Tkach Cc: pgsql-sql@postgresql.org Subject: Re: Debugging postmaster to fix possible bug in Postgres? Followup Date: Fri, 14 Feb 2003 00:01:54 +0100 Message-ID: References: <44sn4vgisulljq45qo35bug12sed1ll3ce@4ax.com> <3E4C212E.2080805@openratings.com> In-Reply-To: <3E4C212E.2080805@openratings.com> X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/302 X-Sequence-Number: 11700 On Thu, 13 Feb 2003 17:50:22 -0500, Dmitry Tkach wrote: >Then it looks like postgres behaviour is still not compliant, if I read it correctly, because > >select x from mytable order by y; > >should be invalid according to this, but works just fine in postres. Yes, this is a Postgres extension to the standard. Your query is handled like SELECT x, y FROM mytable ORDER BY y with y being eliminated after the sort step. This also explains why the OP got the error message ERROR: Attribute t.y must be GROUPed or used in an aggregate function because the implicitely rewritten form would look like SELECT COUNT(*), y FROM t WHERE ... ORDER BY y >P.S. I think, this is a great feature actually (missed it a lot in informix), > so, I hope, you guys won't start discussing how to fix it :-) AFAICT there's no need to worry. Everyone agrees that this is a good feature and it does not break standard SQL queries. Servus Manfred