Andrew Gierth <and...@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to