Re: hstore or jsonb ?

From: Bzzzz <lazyvirus(at)gmx(dot)com>
To: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: hstore or jsonb ?
Date: 2022-11-15 18:51:55
Message-ID: 20221115195155.332eee6a@msi.defcon1.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, 15 Nov 2022 18:32:24 +0100
hubert depesz lubaczewski <depesz(at)depesz(dot)com> wrote:

> > 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/

Thanks for the URL, the difference is indeed quite large.

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

I didn't knew that (and it's not part of the official doc :/)

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

Yeah, it is a problem as some specs can contain a list, I discovered
that last night - so jsonb it'll be.

Jean-Yves

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message mahendrakar s 2023-02-23 13:38:50 using libjansson in postgres extension
Previous Message hubert depesz lubaczewski 2022-11-15 17:32:24 Re: hstore or jsonb ?