Re: Further issues with jsonb semantics, documentation
От | Peter Geoghegan |
---|---|
Тема | Re: Further issues with jsonb semantics, documentation |
Дата | |
Msg-id | CAM3SWZRZ=FaBn8GV1radGxcdcUtSAnJ6ftmkDEB0Gei-4bdriQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Further issues with jsonb semantics, documentation (Andrew Dunstan <andrew@dunslane.net>) |
Список | pgsql-hackers |
On Fri, Jun 5, 2015 at 1:05 PM, Andrew Dunstan <andrew@dunslane.net> wrote: > So probably the least invasive change would be to rename the text[] variant > operator to something like "#-" and rename the corresponding function to > jsonb_delete_path. > > We could also decide not to keep an operator at all, on the ground that we > think we'll implement a type that encapsulates json pointer in 9.6, and just > keep the renamed function. Obviously I prefer the latter option, but the former is still an improvement. To repeat myself, ambiguities around operators are not the only problem: It seems no good to me that there is no way to accomplish an equivalent outcome to that shown below with the similarly-spelled operator you talk about (that is, the operator currently spelled "operator jsonb - text[]"): postgres=# select '["a", "c", "a"]'::jsonb - 'a';?column? ----------["c"] (1 row) With the operator currently spelled "operator jsonb - text[]", at the very least you have to do this instead: postgres=# select '["a", "c", "a"]'::jsonb - '{0}'::text[] - '{1}'::text[];?column? ----------["c"] (1 row) If nothing else, these operators are too dissimilar for overloading to be helpful. -- Peter Geoghegan
В списке pgsql-hackers по дате отправления: