Re: BUG #11207: empty path will segfault jsonb #>
От | Andrew Dunstan |
---|---|
Тема | Re: BUG #11207: empty path will segfault jsonb #> |
Дата | |
Msg-id | 53F5426F.1040300@dunslane.net обсуждение исходный текст |
Ответ на | Re: BUG #11207: empty path will segfault jsonb #> (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: BUG #11207: empty path will segfault jsonb #>
|
Список | pgsql-bugs |
On 08/20/2014 07:30 PM, Tom Lane wrote: > I wrote: >> I think returning NULL is the right thing here, really. Aside from being >> arguably more convenient for indexing, we will get less push-back if we >> make some operators go from throwing errors to returning null than if >> we make some other operators go the other way. > Attached is a proposed patch (against HEAD and 9.4 git tip) that has > these effects: > > 1. #> now returns the input object if the RHS array is empty; So will val #>> '{}' now return a dequoted bare scalar string? I think that's where the OP actually came into this. > > 2. Error cases in -> and #> are all removed in favor of returning NULL. > > The regression test changes show that we were really pretty inconsistent > about whether to throw error or return NULL for cases where the JSON > tree structure didn't match the extraction request. I think having a > uniform rule is a definite improvement. > > Works for me. Thans for cleaning this up. cheers andrew
В списке pgsql-bugs по дате отправления: