Re: Debugging postmaster to fix possible bug in Postgres? Followup

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Debugging postmaster to fix possible bug in Postgres? Followup
Date: 2003-02-13 23:01:54
Message-ID: f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 13 Feb 2003 17:50:22 -0500, Dmitry Tkach
<dmitry(at)openratings(dot)com> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2003-02-13 23:06:27 Re: Extending Datatype
Previous Message Jeff Lu 2003-02-13 23:00:16 postmaster -i & establishes three connections why?