Re: Feedback about Drupal SQL debugging - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Feedback about Drupal SQL debugging
Date
Msg-id 4A8F300C.9090706@dunslane.net
Whole thread Raw
In response to Re: Feedback about Drupal SQL debugging  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers

Greg Stark wrote:
> If Postgres changed on this front it would be to support the SQL
> Standard concept of "functional dependency". In cases where some
> columns are guaranteed to be unique you can leave them out of the
> GROUP BY but still use them in the select list. This isn't MySQL's
> behaviour of just allowing you to leave them out and hope that it
> doesn't matter which row's values are used. The database has to
> actually determine that it really doesn't matter. Typically that would
> be because you've grouped by a set of columns which form the key of a
> unique constraint, in which case every other column from that table
> would also necessarily be the same since they would all come from the
> same row of that table.
>
>   

That would make much more sense.

You can also get the effect of picking an arbitrary row now by use 
max(column) or min(column) in place of the straight column.

cheers

andrew


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Feedback about Drupal SQL debugging
Next
From: Tom Lane
Date:
Subject: Re: Feedback about Drupal SQL debugging