Re: hstore or jsonb ?

hubert depesz lubaczewski <depesz@depesz.com>

From: hubert depesz lubaczewski <depesz@depesz.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Bzzzz <lazyvirus@gmx.com>, pgsql-novice@lists.postgresql.org
Date: 2022-11-15T17:32:24Z
Lists: pgsql-novice
On Tue, Nov 15, 2022 at 06:02:51PM +0100, Laurenz Albe wrote:
> On Tue, 2022-11-15 at 09:39 +0100, hubert depesz lubaczewski wrote:
> > > "hstore" is obsolete; don't use it.
> > 
> > Do you have any support for this claim?
> 
> No.
> 
> But is there anything that hstore can that JSON cannot?

It's faster for some things:
https://www.depesz.com/2021/04/21/getting-value-from-dynamic-column-in-pl-pgsql-triggers/

And it can be trivially used to check for differences in update
triggers:
hstore(NEW) - hstore(OLD)

It's "abusability" is lower thanks to lack of nesting.

depesz