Re: [HACKERS] JSONB - JSONB operator feature request - Mailing list pgsql-hackers

From David Fetter
Subject Re: [HACKERS] JSONB - JSONB operator feature request
Date
Msg-id 20170718162441.GG11340@fetter.org
Whole thread Raw
In response to [HACKERS] JSONB - JSONB operator feature request  (david.turon@linuxbox.cz)
Responses Re: [HACKERS] JSONB - JSONB operator feature request
List pgsql-hackers
On Tue, Jul 18, 2017 at 01:36:32PM +0200, david.turon@linuxbox.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



pgsql-hackers by date:

Previous
From: Shubham Barai
Date:
Subject: [HACKERS] GSoC 2017: weekly progress reports (week 7)
Next
From: Sokolov Yura
Date:
Subject: Re: [HACKERS] Fix performance degradation of contended LWLock on NUMA