pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Andrew Dunstan <andrew@dunslane.net>
To: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Subject: Re: SQL/JSON features for v15
Date: Sat, 27 Aug 2022 12:30:43 -0400
Message-ID: <447324f2-d7f5-5d43-4c0a-6f2e6de30c54@postgresql.org> (raw)
In-Reply-To: <9e182b2c-1069-4356-1de4-b6b804507b8f@dunslane.net>
References: <abd9b83b-aa66-f230-3d6d-734817f0995d@postgresql.org>
	<7d83684b-7932-9f29-400b-0beedfafcdd4@postgrespro.ru>
	<69022273-e7e3-6d1a-10f8-d1b4740e4b97@postgresql.org>
	<92cab50c-152b-84fc-fd49-12b936113a3d@postgresql.org>
	<CA+TgmoaAZq6rRdVA65PBXBKs=jUHhf42Jf78kBLOaX3c6J7MfQ@mail.gmail.com>
	<692364.1661267311@sss.pgh.pa.us>
	<35468585-e18f-3be6-a228-4ec478f796ac@postgresql.org>
	<716936.1661275451@sss.pgh.pa.us>
	<f1c79751-2916-a9cf-c8b9-668b9700edb8@dunslane.net>
	<ab10b5df-fcc2-5871-7027-e7f73b11559d@postgresql.org>
	<3596205e-ce1e-6959-7559-6ddd67f8294b@postgrespro.ru>
	<cc17d718-56a1-359f-2792-01c5debd67e3@dunslane.net>
	<3f8d4c2b-1e58-bf19-580e-64e9755897ef@postgrespro.ru>
	<072a47f0-7a39-2266-5f90-1178a3860be1@dunslane.net>
	<1992b190-f00b-8435-b561-e3c6ac450482@postgresql.org>
	<59660a0b-7b7a-75ab-75c4-b6d53fbda5f6@dunslane.net>
	<6ba7ba7b-9fdd-674f-c227-59a59e0de1ec@postgrespro.ru>
	<9e182b2c-1069-4356-1de4-b6b804507b8f@dunslane.net>

On 8/26/22 4:36 PM, Andrew Dunstan wrote:
> 
> On 2022-08-26 Fr 16:11, Nikita Glukhov wrote:
>>
>> Hi,
>>
>> On 26.08.2022 22:25, Andrew Dunstan wrote:
>>> On 2022-08-24 We 20:05, Nikita Glukhov wrote:
>>>> v8 - is a highly WIP patch, which I failed to finish today.
>>>> Even some test cases fail now, and they simply show unfinished
>>>> things like casts to bytea (they can be simply removed) and missing
>>>> safe input functions.
>>> Thanks for your work, please keep going.
>> I have completed in v9 all the things I previously planned:
>>
>>   - Added missing safe I/O and type conversion functions for
>>     datetime, float4, varchar, bpchar.  This introduces a lot
>>     of boilerplate code for returning errors and also maybe
>>     adds some overhead.
>>
>>   - Added JSON_QUERY coercion to UTF8 bytea using pg_convert_to().
>>
>>   - Added immutability checks that were missed with elimination
>>     of coercion expressions.
>>     Coercions text::datetime, datetime1::datetime2 and even
>>     datetime::text for some datetime types are mutable.
>>     datetime::text can be made immutable by passing ISO date
>>     style into output functions (like in jsonpath).
>>
>>   - Disabled non-Const expressions in DEFAULT ON EMPTY in non
>>     ERROR ON ERROR case.  Non-constant expressions are tried to
>>     evaluate into Const directly inside transformExpr().
>>     Maybe it would be better to simply remove DEFAULT ON EMPTY.
> 
> 
> Yes, I think that's what I suggested upthread. I don't think DEFAULT ON
> EMPTY matters that much, and we can revisit it for release 16. If it's
> simpler please do it that way.
> 
> 
>> It is possible to easily split this patch into several subpatches,
>> I will do it if needed.
> 
> 
> Thanks, probably a good idea but I will start reviewing what you have
> now. Andres and others please chime in if you can.

Thanks Nikita!

I looked through the tests to see if we would need any doc changes, e.g. 
in [1]. I noticed that this hint:

"HINT:  Use ERROR ON ERROR clause or try to simplify expression into 
constant-like form"

lacks a period on the end, which is convention.

I don't know if the SQL/JSON standard calls out if domains should be 
castable, but if it does, we should document in [1] that we are not 
currently supporting them as return types, so that we're only supporting 
"constant-like" expressions with examples.

Looking forward to hearing other feedback.

Thanks,

Jonathan

[1] https://www.postgresql.org/docs/15/functions-json.html#FUNCTIONS-SQLJSON


Attachments:

  OpenPGP_signature (application/pgp-signature, 839B) download

view thread (95+ messages)  latest in thread

Message-ID: <447324f2-d7f5-5d43-4c0a-6f2e6de30c54@postgresql.org>
Permalink:  ../447324f2-d7f5-5d43-4c0a-6f2e6de30c54@postgresql.org/
Also on:    postgresql.org/message-id/447324f2-d7f5-5d43-4c0a-6f2e6de30c54@postgresql.org

 · 

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: jkatz@postgresql.org, andrew@dunslane.net, n.gluhov@postgrespro.ru, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org, michael@paquier.xyz, john.naylor@enterprisedb.com, amitlangote09@gmail.com
  Subject: Re: SQL/JSON features for v15
  In-Reply-To: <447324f2-d7f5-5d43-4c0a-6f2e6de30c54@postgresql.org>

* 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