Re: [GENERAL] Crosstab Problems

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jorge Godoy <jgodoy(at)gmail(dot)com>, scott(dot)marlowe(at)gmail(dot)com, Stefan Schwarzer <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>, regmeplease(at)gmail(dot)com, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [GENERAL] Crosstab Problems
Date: 2007-10-25 22:36:24
Message-ID: 47211A68.4050201@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> Tom Lane wrote:
>>> 1. Treat NULL rowid as a category in its own right. This would conform
>>> with the behavior of GROUP BY and DISTINCT, for instance.
>
>> In any case, the attached changes the behavior to #1 for both flavors of
>> crosstab (the original crosstab(text, int) and the usually more useful
>> crosstab(text, text)).
>
>> It is appropriate for 8.3 but not back-patching as it changes behavior
>> in a non-backward compatible way and is probably too invasive anyway.
>
> Um, if the previous code crashed in this case, why would you worry about
> being backward-compatible with it? You're effectively changing the
> behavior anyway, so you might as well make it do what you've decided is
> the right thing.

Well, maybe the attached patches better explain what I mean.

In the case of the 8.2 patch, a very small code change allows new
regression data including NULL rowids to:

1) not crash
2) have no impact otherwise

The much bigger 8.3 patch shows that for the very same new regression
data, there is a significant impact on the output (i.e. NULL rowids get
their own output row as discussed).

I'm still leaning toward applying the 8.2 patch for back branches but
I'll bow to the general consensus.

Joe

Attachment Content-Type Size
tablefunc.head.diff text/x-patch 24.2 KB
tablefunc.8.2.diff text/x-patch 3.5 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Smith 2007-10-25 22:36:37 Re: 2 versions running & using pg_dumpall
Previous Message Eva Elizalde 2007-10-25 22:35:05 sql

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-10-26 00:38:42 Re: Autovacuum cancellation
Previous Message Gregory Stark 2007-10-25 22:28:39 Re: Autovacuum cancellation