Re: GROUPING

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GROUPING
Дата
Msg-id 27612.1432222959@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GROUPING  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> So. Options:

> 1) change GROUPING() to return bigint and otherwise leave it as is.

> 2) change GROUPING() to return numeric.

> 3) change GROUPING() so that the result type varies with the number of
> args. I don't see anything in the spec that actually forbids this - it
> just says the return type is implementation-defined exact numeric.

I'd go with (1) --- it's cheap and doesn't lose any capability.  If you
do (2), you'd lose useful operations like &, unless you cast back to int
which pretty much defeats the purpose.  And (3) is just weird and will
confuse people, especially since numeric and int don't have identical
sets of operations.

Or we could just leave things alone.  But (1) seems like pretty cheap
insurance.


> A) in addition to any of the above, implement GROUPING_ID() as a simple
> alias for GROUPING().

I see no reason to do that.  We don't need to copy Oracle-isms; the
language is already complicated enough.
        regards, tom lane



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Redesigning checkpoint_segments
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Minor improvements to alter_foreign_table.sgml