Re: Crosstab Problems

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Crosstab Problems
Дата
Msg-id 3161.1192763352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Crosstab Problems  (Jorge Godoy <jgodoy@gmail.com>)
Ответы Re: Crosstab Problems  (Joe Conway <mail@joeconway.com>)
Re: Crosstab Problems  (Gregory Stark <stark@enterprisedb.com>)
Re: Crosstab Problems  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
Jorge Godoy <jgodoy@gmail.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.

3. Throw a NOTICE or WARNING (hopefully only one message not repeated
ones) if NULL rowid is seen, then ignore the row.

4. Silently ignore rows with NULL rowid.

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.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re : Abbreviation list
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Abbreviation list