Re: [HACKERS] DISTINCT and ORDER BY bug? - Mailing list pgsql-hackers

From Taral
Subject Re: [HACKERS] DISTINCT and ORDER BY bug?
Date
Msg-id Pine.LNX.4.10.10002070011270.27753-100000@r149127-2815.dobiecenter.com
Whole thread Raw
In response to Re: [HACKERS] DISTINCT and ORDER BY bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 7 Feb 2000, Tom Lane wrote:

> Well, it's not a bug --- it was an entirely deliberate change.  It
> might be a misfeature though.  The case we were concerned about was
> 
>     select distinct x from foo order by y;
> 
> which produces ill-defined results. 

Okay, I can understand this...

>     select distinct sin(x) from foo order by abs(sin(x));
> 
>     select distinct random(x) from foo order by abs(random(x));

The thing here is that random() is not deterministic on its inputs,
whereas sin() is. Perhaps we should only allow fully deterministic ORDER
BY? (Ugh, another flag for functions...)

Taral



pgsql-hackers by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: [HACKERS] Advice needed,
Next
From: Don Baccus
Date:
Subject: Re: [HACKERS] ONLY