Search Postgresql Archives

Re: concatenating hstores in a group by?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> On Friday, January 17, 2025, Brent Wood <Brent.Wood@xxxxxxxxxx> wrote:
>> I want to concatenate the hstores,

> There are no hstore aggregate functions.

It would be trivial to make a user-defined one.
More or less (untested)

create aggregate hstore_agg(hstore)
(
  sfunc = hs_concat,
  stype = hstore
);

Either way though, the order of aggregation is unspecified and thus
it's unclear which input will win when there are duplicate keys.
If that matters then you'll need to think about how you want
to resolve it.

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux