Re: Further issues with jsonb semantics, documentation - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Further issues with jsonb semantics, documentation
Date
Msg-id CAM3SWZS+HwRXG_vAhfZOU6YwmvZii3vUcwx0XKvQ7_28HEEL-w@mail.gmail.com
Whole thread Raw
In response to Re: Further issues with jsonb semantics, documentation  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Thu, Jun 4, 2015 at 1:02 PM, Peter Geoghegan <pg@heroku.com> wrote:
> I would like these new-to-9.5 deletion operators to work at the top
> level only, like "operator jsonb ? text" and "operator jsonb ?| text",
> sharing their idea of a key, __including that string array elements
> are keys__. We haven't got a containment-style nested delete operator
> for 9.5, but we can hope for it in the future. In the meantime, you
> get much of the benefit of that with jsonb_delete(), which *can*
> support nested deletion. It does so by buying into the "operator jsonb
> ? text" idea of a key (including that string array elements are keys),
> although with a twist: the paths text[] right operand operates at
> multiple nesting levels (not supporting traversing arrays, as Andrew
> implemented it, but OTOH adding support for deleting String array
> elements based on the string alone, useful for "tag" arrays).
>
> If in 9.6 we have something like an "operator jsonb @- jsonb" operator
> for containment style deletion, and a 9.5 era "operator jsonb - text"
> and operator jsonb - text[]" pair of operators for existence style
> deletion (matching "operator jsonb ? text", operating only on the top
> level), that will be pretty good. The fact that jsonb_delete() will
> have somewhat bridged the gap nesting-deletion-wise for 9.5 (without
> being usable through an operator) won't really matter then. I want to
> keep the "twist" I described out of any jsonb operators that are
> shipped, and only use it within functions.

To be clear: these two paragraphs are a proposal about how I'd like to
change things for 9.5 to make the jsonb operators more consistent than
the way things are in the master branch, while still offering nested
deletion through a function.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Further issues with jsonb semantics, documentation
Next
From: Guillaume Lelarge
Date:
Subject: Re: Publish autovacuum informations