Re: Combining Aggregates

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila(at)enterprisedb(dot)com>
Subject: Re: Combining Aggregates
Date: 2016-01-23 00:53:05
Message-ID: CAKJS1f_bQ6Ashpk51t2NgtjYZ2a2c_7pFGdJ1U7Fs7uqB-nbmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23 January 2016 at 09:44, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> On 23 January 2016 at 09:17, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> On Wed, Jan 20, 2016 at 11:06 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> On Wed, Jan 20, 2016 at 7:38 AM, David Rowley
>>> <david(dot)rowley(at)2ndquadrant(dot)com> wrote:
>>>> Agreed. So I've attached a version of the patch which does not have any of
>>>> the serialise/deserialise stuff in it.
>>>
>>> I re-reviewed this and have committed most of it with only minor
>>> kibitizing. A few notes:
>>
>>
>> This commit has broken pg_dump. At least, I think this is the thread
>> referencing this commit:
>>
> ...
>> pg_dump: column number -1 is out of range 0..17
>> Segmentation fault (core dumped)
>>
>> Program terminated with signal 11, Segmentation fault.
>> #0 0x0000000000416b0b in dumpAgg (fout=0x1e551e0, agginfo=0x1e65ec0)
>> at pg_dump.c:12670
>> 12670 if (strcmp(aggcombinefn, "-") != 0)
>> (gdb) bt
>> #0 0x0000000000416b0b in dumpAgg (fout=0x1e551e0, agginfo=0x1e65ec0)
>> at pg_dump.c:12670
>> #1 0x000000000041df7a in main (argc=<value optimized out>,
>> argv=<value optimized out>) at pg_dump.c:810
>
> Yikes :-( I will look at this with priority in the next few hours.
>
> Thanks for the report.

It seems that I must have mistakenly believed that non-existing
columns for previous versions were handled using the power of magic.
Turns out that I was wrong, and they need to be included as dummy
columns in the queries for previous versions.

The attached fixes the problem.

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

Attachment Content-Type Size
combine_aggs_pg_dump_fix.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-01-23 01:35:59 Re: silent data loss with ext4 / all current versions
Previous Message Tom Lane 2016-01-22 23:44:06 Re: Removing Functionally Dependent GROUP BY Columns