Re: Bug? Changing where distinct occurs produces error?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Michael Loftis <mloftis(at)wgops(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug? Changing where distinct occurs produces error?
Date: 2006-07-07 22:19:29
Message-ID: 20060707151449.R86003@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, 7 Jul 2006, Michael Loftis wrote:

> OK I'm either insane or found a bug in 8.1.3
>
> If you execute say:
>
> SELECT DISTINCT(ua.user_id),pa.poll_id FROM user_answers ua, poll_answers
> pa WHERE pa.poll_answer_id = ua.poll_answer_id AND ua.active='Y';
>
> Everything is fine, however if you run
>
> SELECT pa.poll_id,DISTINCT(ua.user_id) FROM user_answers ua, poll_answers
> pa WHERE pa.poll_answer_id = ua.poll_answer_id AND ua.active='Y';

This statement is invalid. DISTINCT is a set quantifier and either comes
before the select list or as the first thing in a set function
specification.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-07-07 22:22:01 Re: Bug? Changing where distinct occurs produces error?
Previous Message Michael Loftis 2006-07-07 21:52:01 Bug? Changing where distinct occurs produces error?