Set returning aggregate?

From: Bborie Park <dustymugs(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Set returning aggregate?
Date: 2013-12-08 19:40:37
Message-ID: CAKVfRvHJhL0ZQN+FaJTgZqNTcV+6ae-wCKz=iUpugJdtQZ7rJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm wondering if an aggregate function can return a set of records?

Say I have a table with a column of type raster (PostGIS). I want to get
the number of times the pixel values 1, 3 and 4 occur in that raster
column. I am hoping to build an aggregrate function that returns the
following...

value | count
--------+--------
1 | 12
--------+--------
2 | 12
--------+--------
3 | 12

Is it possible for an aggregate function to return a set? I've written some
test cases and it looks like the answer is No but I'd like confirmation.

Thanks,
Bborie Park

PostGIS Steering Committee

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-12-08 19:56:48 Re: Set returning aggregate?
Previous Message Kaare Rasmussen 2013-12-08 11:18:02 Re: hstore syntax