GROUPING - Mailing list pgsql-hackers

From David Fetter
Subject GROUPING
Date
Msg-id 20150520180702.GC27945@fetter.org
Whole thread Raw
Responses Re: GROUPING  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Folks,

While kicking the tires on the new GROUPING() feature, I noticed that
NUMERIC has no cast to bit(n).  GROUPING() produces essentially a
bitmap, although the standard mandates for some reason that it be a
numeric type.

I was thinking it should produce NUMERIC rather than int4 as it does
now in order to accommodate large numbers of columns, but the
usefulness of the bitmap is greatly increased if there's a simple CAST
to bit(n).

Contravening the spec, but much more usefully, GROUPING should
probably produce a (possibly ordered) set of key-value pairs.
Alternatively, we could create something like GROUPING_JSON().

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Next
From: "alejandro"
Date:
Subject: Improving GEQO