pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Manfred Koizar <mkoi-pg@aon.at>
To: Dmitry Tkach <dmitry@openratings.com>
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: <f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com> (raw)
In-Reply-To: <3E4C212E.2080805@openratings.com>
References: <44sn4vgisulljq45qo35bug12sed1ll3ce@4ax.com>
	<3E4C212E.2080805@openratings.com>

On Thu, 13 Feb 2003 17:50:22 -0500, Dmitry Tkach
<dmitry@openratings.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



view thread (9+ messages)  latest in thread

Message-ID: <f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com>
Permalink:  ../f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com/
Also on:    postgresql.org/message-id/f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mkoi-pg@aon.at, dmitry@openratings.com
  Subject: Re: Debugging postmaster to fix possible bug in Postgres? Followup
  In-Reply-To: <f08o4vc1nd01ap1r4loq9m4g20rbsc384m@4ax.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox