Re: [HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-23 Thread Michael Paquier
On Wed, Mar 23, 2016 at 11:01 PM, Tom Lane wrote: > Michael Paquier writes: >> That's ugly. We should actually use TextDatumGetCString because the >> index is stored as text here via a Datum, and then it is converted >> back to an integer. So I propose instead the simple patch attached >> that fi

Re: [HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-23 Thread Tom Lane
Michael Paquier writes: > That's ugly. We should actually use TextDatumGetCString because the > index is stored as text here via a Datum, and then it is converted > back to an integer. So I propose instead the simple patch attached > that fixes the failure for me. Could you check if that works for

Re: [HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-23 Thread Michael Paquier
On Wed, Mar 23, 2016 at 7:48 PM, Vitaly Burovoy wrote: > On 2016-03-23, Oleg Bartunov wrote: >> On Wed, Mar 23, 2016 at 6:37 AM, Vitaly Burovoy >> wrote: >> >>> Hello, Hackers! >>> >>> While I was reviewed a patch with "json_insert" function I found a bug >>> which wasn't connected with the patc

Re: [HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-23 Thread Vitaly Burovoy
On 2016-03-23, Oleg Bartunov wrote: > On Wed, Mar 23, 2016 at 6:37 AM, Vitaly Burovoy > wrote: > >> Hello, Hackers! >> >> While I was reviewed a patch with "json_insert" function I found a bug >> which wasn't connected with the patch and reproduced at master. >> >> It claims about non-integer whe

Re: [HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-23 Thread Oleg Bartunov
On Wed, Mar 23, 2016 at 6:37 AM, Vitaly Burovoy wrote: > Hello, Hackers! > > While I was reviewed a patch with "json_insert" function I found a bug > which wasn't connected with the patch and reproduced at master. > > It claims about non-integer whereas input values are obvious integers > and in

[HACKERS] Bug in searching path in jsonb_set when walking through JSONB array

2016-03-22 Thread Vitaly Burovoy
Hello, Hackers! While I was reviewed a patch with "json_insert" function I found a bug which wasn't connected with the patch and reproduced at master. It claims about non-integer whereas input values are obvious integers and in an allowed range. More testing lead to understanding it appears when