Re: Bug Fix: COLLATE with multiple ORDER BYs in aggregates

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug Fix: COLLATE with multiple ORDER BYs in aggregates
Date: 2013-04-25 17:55:19
Message-ID: 20130425175519.GI11158@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-04-25 13:42:32 -0400, Tom Lane wrote:
> David Fetter <david(at)fetter(dot)org> writes:
> > While testing the upcoming FILTER clause for aggregates, Erik Rijkers
> > uncovered a long-standing bug in $subject, namely that this case
> > wasn't handled. Please find attached a patch by Andrew Gierth and
> > myself which fixes this issue and adds a regression test to ensure it
> > remains fixed.
>
> I don't find this patch to be a good idea.
>
> The argument for it seems to be that
>
> array_agg(a COLLATE "C" ORDER BY b COLLATE "POSIX")
>
> should not throw an error, but why not?

Uh. Why should it? SELECT foo COLLATE "C" FROM ... ORDER BY bar COLLATE
"POSIX" doesn't throw one either?

> And what does that have to do with whacking around the code for CASE?

I guess that's to avoid to repeat that already triplicated block of code
once more. The goal seems to make sense to me, although I am not 100%
that thats the nicest solution to get of the repetition.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Timothy Garnett 2013-04-25 17:56:22 Re: Allowing parallel pg_restore from pipe
Previous Message Tom Lane 2013-04-25 17:42:32 Re: Bug Fix: COLLATE with multiple ORDER BYs in aggregates