pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: John Naylor <john.naylor@enterprisedb.com>
Subject: Re: SQL/JSON features for v15
Date: Thu, 1 Sep 2022 16:54:42 +0300
Message-ID: <0574201c-bd35-01af-1557-8936f99ce5aa@postgrespro.ru> (raw)
In-Reply-To: <379e5365-9670-e0de-ee08-57ba61cbc976@postgrespro.ru>
References: <CA+HiwqH8gTp2uNN3QtgeOSgHhZUZz1=0U+JObJJUmEoch_269Q@mail.gmail.com>
	<20220830092008.6dbublx6la226zis@alvherre.pgsql>
	<CA+HiwqFvP23i3kTHt6TW4FqO6he1YSJXeyGOdFV_YbP=xeS99A@mail.gmail.com>
	<f54ebd2b-0e67-d1c6-4ff7-5d732492d1a0@postgrespro.ru>
	<CA+HiwqHLVPdA7e3Y-S5giKPsqQPf8M0nuvgz8+3D8GjQexXLYA@mail.gmail.com>
	<CA+HiwqECHA0aUi0Bo3tdYTJ27i2MRWUZ5BewQoO0WgRvRXQO-Q@mail.gmail.com>
	<abd31e0b-56aa-044f-6700-8a1c1bba87f1@dunslane.net>
	<2276d20d-43ff-f9f6-5c9c-c2875739e66c@postgresql.org>
	<20220831154916.pgspuz3bp4427int@awork3.anarazel.de>
	<4151123.1661961884@sss.pgh.pa.us>
	<13351.1661965592@sss.pgh.pa.us>
	<CA+TgmobX2330ByUrrSo1SbcoRPYBbZ1bp3h54hLsxsd1AeBocQ@mail.gmail.com>
	<14814.1661966096@sss.pgh.pa.us>
	<379e5365-9670-e0de-ee08-57ba61cbc976@postgrespro.ru>

On 31.08.2022 23:39, Nikita Glukhov wrote:

> And here is a quick POC patch with an example for COPY and float4

I decided to go further and use new API in SQL/JSON functions
(even if it does not make real sense now).

I have added function for checking expressions trees, special
executor steps for handling errors in FuncExpr, CoerceViaIO,
CoerceToDomain which are passed through ExprState.edata.

Of course, there is still a lot of work:
   1. JIT for new expression steps
   2. Removal of subsidary ExprStates (needs another solution for
     ErrorData passing)
   3. Checking of domain constraint expressions
   4. Error handling in coercion to bytea
   5. Error handling in json_populate_type()
   6. Error handling in jsonb::type casts
   7. ...


Also I have added lazy creation of JSON_VALUE coercions, which was
not present in previous patches.  It really greatly speeds up JIT
and reduces memory consumption.  But it requires using of subsidary
ExprStates.


jsonb_sqljson test now fails because of points 4, 5, 6.

--
Nikita Glukhov
Postgres Professional:http://www.postgrespro.com
The Russian Postgres Company

Attachments:

  fix-sqljson-executor-v11.tgz (application/x-compressed-tar, 35.8K) download

view thread (95+ messages)  latest in thread

Message-ID: <0574201c-bd35-01af-1557-8936f99ce5aa@postgrespro.ru>
Permalink:  ../0574201c-bd35-01af-1557-8936f99ce5aa@postgrespro.ru/
Also on:    postgresql.org/message-id/0574201c-bd35-01af-1557-8936f99ce5aa@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: n.gluhov@postgrespro.ru, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, jkatz@postgresql.org, andrew@dunslane.net, amitlangote09@gmail.com, alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org, michael@paquier.xyz, john.naylor@enterprisedb.com
  Subject: Re: SQL/JSON features for v15
  In-Reply-To: <0574201c-bd35-01af-1557-8936f99ce5aa@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox