Re: SQL/JSON: JSON_TABLE

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Erik Rijkers <er(at)xs4all(dot)nl>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>
Subject: Re: SQL/JSON: JSON_TABLE
Date: 2022-01-04 14:03:05
Message-ID: 5066009a-827c-bfe7-2ba8-33a43eeaa05a@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 9/16/21 10:55, Andrew Dunstan wrote:
> On 9/14/21 3:18 PM, Andrew Dunstan wrote:
>> On 9/14/21 2:04 PM, Erik Rijkers wrote:
>>> On 9/14/21 2:53 PM, Andrew Dunstan wrote:
>>>> On 9/13/21 5:41 AM, Erik Rijkers wrote:
>>>>> On 9/2/21 8:52 PM, Andrew Dunstan wrote:
>>>>>
>>>>> [0001-SQL-JSON-functions-v51.patch]
>>>>> [0002-JSON_TABLE-v51.patch]
>>>>> [0003-JSON_TABLE-PLAN-DEFAULT-clause-v51.patch]
>>>>> [0004-JSON_TABLE-PLAN-clause-v51.patch]
>>> Thanks, builds fine now.
>>>
>>> But I found that the server crashes on certain forms of SQL when
>>> postgresql.conf has a 'shared_preload_libraries' that contains module
>>> 'pg_stat_statements' (my value was:
>>> 'pg_stat_statements,auth_delay,auto_explain,passwordcheck').  Only
>>> pg_stat_statements seems to cause the problem.
>>>
>>> The offending SQL (I took it from the jsonb_sqljson.sql test file):
>>>
>>> testdb=# SELECT JSON_EXISTS(jsonb '{"a": 1, "b": 2}', '$.* ? (@ > $x
>>> && @ < $y)' PASSING 0 AS x, 2 AS y);
>>> server closed the connection unexpectedly
>>>         This probably means the server terminated abnormally
>>>         before or while processing the request.
>>> The connection to the server was lost. Attempting reset: Failed.
>>> Time: 2.551 ms
>>> !?>
>>>
>>> (Of course, that SQL running during regression testing has no problems
>>> as there is then no pg_stat_statements.)
>>>
>>> The statement sometimes succeeds but never very often.
>>>
>>> The same crash was there before but I only now saw the connection with
>>> the 'shared_preload_libraries/pg_stat_statements'.
>>>
>>> I seem to remember some things changed in pg_stat_statements but I
>>> didn't follow and don't know who to CC for it.
>>>
>>>
>> Yeah, I had to make a change in that area, looks like I got it wrong.
>> I'll follow up. Thanks for the report.
>>
> Rebased and fixed. It's actually an old bug, I reproduced it with a
> previous patch set.
>
>

rebased again.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
0001-SQL-JSON-functions-v53.patch text/x-patch 468.4 KB
0002-JSON_TABLE-v53.patch text/x-patch 122.7 KB
0003-JSON_TABLE-PLAN-DEFAULT-clause-v53.patch text/x-patch 27.4 KB
0004-JSON_TABLE-PLAN-clause-v53.patch text/x-patch 71.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-01-04 14:18:30 Re: [PATCH] Allow multiple recursive self-references
Previous Message Andrew Dunstan 2022-01-04 14:01:31 Re: SQL/JSON: functions