Re: 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>, pgsql-general(at)postgresql(dot)org, Stefan Schwarzer <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>
Subject: Re: Crosstab Problems
Date: 2007-10-19 04:09:33
Message-ID: 47182DFD.6090703@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Tom Lane wrote:
> Jorge Godoy <jgodoy(at)gmail(dot)com> writes:
>> Em Thursday 18 October 2007 16:37:59 Joe Conway escreveu:
>>> The row is pretty useless without a rowid in this context -- it seems
>>> like the best thing to do would be to skip those rows entirely. Of
>>> course you could argue I suppose that it ought to throw an ERROR and
>>> bail out entirely. Maybe a good compromise would be to skip the row but
>>> throw a NOTICE?
>
>> If I were using it and having this problem I'd rather have an ERROR.
>
> I can think of four reasonably credible alternatives:
>
> 1. Treat NULL rowid as a category in its own right. This would conform
> with the behavior of GROUP BY and DISTINCT, for instance.
>
> 2. Throw an ERROR if NULL rowid is seen.

> Not being a heavy user of crosstab(), I'm not sure which of these is the
> most appropriate, but #1 seems the most defensible from a theoretical
> perspective.
>
> Since the bug has gone undiscovered this long, it seems obvious that
> not too many people actually try to feed null rowids to crosstab; so
> expending a lot of effort to fix it is probably not reasonable.
> If you don't like #1 I'd vote for #2 second.

Hadn't really thought about #1, but now that you mention it, it does
make sense. #1 gets my vote too. I'll pick this up next week if that's OK.

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harald Armin Massa 2007-10-19 04:18:19 Re: Abbreviation list
Previous Message Bruce Momjian 2007-10-19 04:02:32 Re: Abbreviation list

Browse pgsql-patches by date

  From Date Subject
Next Message Stefan Schwarzer 2007-10-19 08:45:16 Re: Crosstab Problems
Previous Message Tom Lane 2007-10-19 03:09:12 Re: Crosstab Problems