Re: [HACKERS] DISTINCT and ORDER BY bug?

From: Taral <taral(at)taral(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Don Baccus <dhogaza(at)pacifier(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] DISTINCT and ORDER BY bug?
Date: 2000-02-07 06:12:47
Message-ID: Pine.LNX.4.10.10002070011270.27753-100000@r149127-2815.dobiecenter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message kaiq 2000-02-07 06:15:34 Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL
Previous Message Don Baccus 2000-02-07 06:11:24 Re: [HACKERS] ONLY