Re: Patch: Improve Boolean Predicate JSON Path Docs

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch: Improve Boolean Predicate JSON Path Docs
Date: 2023-10-16 19:59:27
Message-ID: 37B1EB9E-E44F-4B20-89E9-AFAC37B62BC6@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Oct 15, 2023, at 23:03, Erik Wienhold <ewie(at)ewie(dot)name> wrote:

> Your call but I'm not against including it in this patch because it
> already touches the modes section.

Okay, added, let’s just put all our cards on the table. :-)

>> Agreed. Would be good if we could teach these functions and operators
>> to reject path expressions they don’t support.
>
> Right, you mentioned that idea in [1] (separate types). Not sure what
> the best strategy here is but it's likely to break existing queries.
> Maybe deprecating unsupported path expressions in the next major release
> and changing that to an error in the major release after that.

Well if the functions have a JsonPathItem struct, they can check its type attribute and reject those with a root type that’s a predicate in @? and reject it if it’s not a predicate in @@. Example of checking type here:

https://github.com/postgres/postgres/blob/54b208f90963cb8b48b9794a5392b2fae4b40a98/src/backend/utils/adt/jsonpath_exec.c#L622

>>> This can be checked with `make -C doc/src/sgml check`.
>>
>> Thanks. That produces a bunch of warnings for postgres.sgml and
>> legal.sgml (and a failure to load the docbook DTD), but func.sgml is
>> clean now.
>
> Hmm... I get no warnings on 1f89b73c4e. Did you install all tools as
> described in [2]? The DTD needs to be installed as well.

Thanks, got it down to one:

postgres.sgml:112: element sect4: validity error : Element sect4 content does not follow the DTD, expecting (sect4info? , (title , subtitle? , titleabbrev?) , (toc | lot | index | glossary | bibliography)* , (((calloutlist | glosslist | bibliolist | itemizedlist | orderedlist | segmentedlist | simplelist | variablelist | caution | important | note | tip | warning | literallayout | programlisting | programlistingco | screen | screenco | screenshot | synopsis | cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis | constructorsynopsis | destructorsynopsis | methodsynopsis | formalpara | para | simpara | address | blockquote | graphic | graphicco | mediaobject | mediaobjectco | informalequation | informalexample | informalfigure | informaltable | equation | example | figure | table | msgset | procedure | sidebar | qandaset | task | anchor | bridgehead | remark | highlights | abstract | authorblurb | epigraph | indexterm | beginpage)+ , (refentry* | sect5* | simplesect*)) | refentry+ | sect5+ | simplesect+) , (toc | lot | index | glossary | bibliography)*), got (para para )
&func;

David

Attachment Content-Type Size
v3-0001-Improve-boolean-predicate-JSON-Path-docs.patch application/applefile 114 bytes
unknown_filename text/plain 2 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-10-16 20:00:49 Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound
Previous Message Peter Geoghegan 2023-10-16 19:45:54 Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound