Re: More new SQL/JSON item methods

From: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: More new SQL/JSON item methods
Date: 2023-11-06 13:23:06
Message-ID: CAM2+6=UrDfcsz0xn+oUmomOnPYazuP8dAM_Wrx5YMsWxXjWyKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 1, 2023 at 3:49 PM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

>
> On 2023-11-01 We 03:00, Jeevan Chalke wrote:
>
> Hello,
>
> On Tue, Oct 24, 2023 at 6:41 PM Andrew Dunstan <andrew(at)dunslane(dot)net>
> wrote:
>
>>
>> On 2023-10-19 Th 02:06, Jeevan Chalke wrote:
>>
>> Thanks, Peter for the comments.
>>
>> On Fri, Oct 6, 2023 at 5:13 PM Peter Eisentraut <peter(at)eisentraut(dot)org>
>> wrote:
>>
>>> On 29.08.23 09:05, Jeevan Chalke wrote:
>>> > v1-0001-Implement-jsonpath-.bigint-.integer-and-.number-m.patch
>>> >
>>> > This commit implements jsonpath .bigint(), .integer(), and .number()
>>> > methods. The JSON string or a numeric value is converted to the
>>> > bigint, int4, and numeric type representation.
>>>
>>> A comment that applies to all of these: These add various keywords,
>>> switch cases, documentation entries in some order. Are we happy with
>>> that? Should we try to reorder all of that for better maintainability
>>> or readability?
>>>
>>
>> Yeah, that's the better suggestion. While implementing these methods, I
>> was confused about where to put them exactly and tried keeping them in some
>> logical place.
>> I think once these methods get in, we can have a follow-up patch
>> reorganizing all of these.
>>
>>
>> I think it would be better to organize things how we want them before
>> adding in more stuff.
>>
>
> I have tried reordering all the jsonpath Operators and Methods
> consistently. With this patch, they all appear in the same order when
> together in the group.
>
> In some switch cases, they are still divided, like in
> flattenJsonPathParseItem(), where 2-arg, 1-arg, and no-arg cases are
> clubbed together. But I have tried to keep them in order in those subgroups.
>
> I will rebase my patches for this task on this patch, but before doing so,
> I would like to get your views on this reordering.
>
>
>
> This appears to be reasonable. Maybe we need to add a note in one or two
> places about maintaining the consistency?
>
+1
Added a note in jsonpath.h where enums are defined.

I have rebased all three patches over this reordering patch making 4
patches in the set.

Let me know your views on the same.

Thanks

>
> cheers
>
>
> andrew
>
> --
> Andrew Dunstan
> EDB: https://www.enterprisedb.com
>
>

--
Jeevan Chalke

*Senior Staff SDE, Database Architect, and ManagerProduct Development*

edbpostgres.com

Attachment Content-Type Size
v3-0002-Implement-jsonpath-.number-.decimal-precision-sca.patch application/octet-stream 52.8 KB
v3-0001-Reorganise-jsonpath-Operators-and-Methods.patch application/octet-stream 15.2 KB
v3-0004-Implement-jsonpath-.boolean-and-.string-methods.patch application/octet-stream 24.8 KB
v3-0003-Implement-jsonpath-.date-.time-.time_tz-.timestam.patch application/octet-stream 93.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-11-06 13:34:41 Re: apply pragma system_header to python headers
Previous Message Laurenz Albe 2023-11-06 13:23:04 Wrong security context for deferred triggers?