Re: JSONB - JSONB operator feature request

From: David Fetter <david(at)fetter(dot)org>
To: david(dot)turon(at)linuxbox(dot)cz
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: JSONB - JSONB operator feature request
Date: 2017-07-18 16:24:41
Message-ID: 20170718162441.GG11340@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 18, 2017 at 01:36:32PM +0200, david(dot)turon(at)linuxbox(dot)cz wrote:
> Hi,
>
> some users and me used hstore - hstore for example storing only changed
> rows in trigger like:
>
> hstore(NEW) - hstore(OLD)
>
> There isn't same operator/function in JSON/JSONB. We can only remove keys
> from JSONB, but not equal key-value pairs. Is there any chance to have
> same feature with JSON/JSONB in postgres core?

What would - mean precisely for JSON[B]?

For example, what would you expect

SELECT '{"a": 1, "b": {"c": 2}}'::JSONB - '{"b": 1, "b": {"c": 3}}'::JSONB

to yield?

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sokolov Yura 2017-07-18 17:20:43 Re: Fix performance degradation of contended LWLock on NUMA
Previous Message Shubham Barai 2017-07-18 14:36:01 GSoC 2017: weekly progress reports (week 7)