pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
fix old confusing JSON example
8+ messages / 5 participants
[nested] [flat]

Commits from this thread:
  2021-04-16 254a2164e5 0e8acd39ec 26cf32455c  doc: Fix typo in example query of SQL/JSON
* fix old confusing JSON example
@ 2021-04-03 12:01 Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:32 ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
  0 siblings, 2 replies; 8+ messages in thread

From: Erik Rijkers @ 2021-04-03 12:01 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org <pgsql-committers@lists.postgresql.org>

Hello,

Attached is a small but confusing mistake in the json documentation (a @@ instead of @?) that has been there since version 12.  (It took me quite some time to figure that out while testing with the recent SQL/JSON patches -- which I initially blamed).
 
To be applied from 12, 13, and master.

Thanks,

Erik Rijkers

Attachments:

json.sgml.20210403.diff (text/x-patch, 632B) download --- doc/src/sgml/json.sgml.orig 2021-04-03 13:47:29.484510936 +0200 +++ doc/src/sgml/json.sgml 2021-04-03 13:47:53.028866752 +0200 @@ -489,7 +489,7 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"'; </programlisting> <programlisting> -SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ? (@ == "qui")'; +SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @? '$.tags[*] ? (@ == "qui")'; </programlisting> GIN index extracts statements of following form out of <literal>jsonpath</literal>: <replaceable>accessors_chain</replaceable> = <replaceable>const</replaceable>.
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
@ 2021-04-03 12:28 ` Erik Rijkers <er@xs4all.nl>
  2021-04-16 08:00   ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 8+ messages in thread

From: Erik Rijkers @ 2021-04-03 12:28 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>

> On 2021.04.03. 14:01 Erik Rijkers <er@xs4all.nl> wrote:
>  
> Hello,
> 
> Attached is a small but confusing mistake in the json documentation (a @@ instead of @?) that has been there since version 12.  (It took me quite some time to figure that out while testing with the recent SQL/JSON patches -- which I initially blamed).
>  
> To be applied from 12, 13, and master.

Oops, sent to wrong list.

Let me add some arguments for the change:

The original text is:
--------------------------
Also, GIN index supports @@ and @? operators, which perform jsonpath matching.

  SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
  SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ? (@ == "qui")';

--------------------------
So, that gives information on two operators, and then gives one example query for each.  Clearly, the second example was meant to illustrate a where-clause with the  @?  operator.

Small change to prevent great confusion (I'll admit it took me far too long to understand this).

thanks,

Erik Rijkers




















> 
> Thanks,
> 
> Erik Rijkers

Attachments:

json.sgml.20210403.diff (text/x-patch, 632B) download --- doc/src/sgml/json.sgml.orig 2021-04-03 13:47:29.484510936 +0200 +++ doc/src/sgml/json.sgml 2021-04-03 13:47:53.028866752 +0200 @@ -489,7 +489,7 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"'; </programlisting> <programlisting> -SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ? (@ == "qui")'; +SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @? '$.tags[*] ? (@ == "qui")'; </programlisting> GIN index extracts statements of following form out of <literal>jsonpath</literal>: <replaceable>accessors_chain</replaceable> = <replaceable>const</replaceable>.
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
@ 2021-04-16 08:00   ` Michael Paquier <michael@paquier.xyz>
  2021-04-16 14:25     ` Re: fix old confusing JSON example Alexander Korotkov <aekorotkov@gmail.com>
  2021-04-20 19:07     ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  0 siblings, 2 replies; 8+ messages in thread

From: Michael Paquier @ 2021-04-16 08:00 UTC (permalink / raw)
  To: Erik Rijkers <er@xs4all.nl>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>

On Sat, Apr 03, 2021 at 02:28:38PM +0200, Erik Rijkers wrote:
> So, that gives information on two operators, and then gives one
> example query for each.  Clearly, the second example was meant to
> illustrate a where-clause with the  @?  operator. 
> 
> Small change to prevent great confusion (I'll admit it took me far
> too long to understand this). 

Once one guesses the definition of the table to use with the sample
data at disposal in the docs, it is easy to see that both queries
should return the same result, but the second one misses the shot and
is corrected as you say.  So, applied.

My apologies for the delay.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-16 08:00   ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
@ 2021-04-16 14:25     ` Alexander Korotkov <aekorotkov@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Alexander Korotkov @ 2021-04-16 14:25 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Erik Rijkers <er@xs4all.nl>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>

On Fri, Apr 16, 2021 at 11:00 AM Michael Paquier <michael@paquier.xyz> wrote:
> On Sat, Apr 03, 2021 at 02:28:38PM +0200, Erik Rijkers wrote:
> > So, that gives information on two operators, and then gives one
> > example query for each.  Clearly, the second example was meant to
> > illustrate a where-clause with the  @?  operator.
> >
> > Small change to prevent great confusion (I'll admit it took me far
> > too long to understand this).
>
> Once one guesses the definition of the table to use with the sample
> data at disposal in the docs, it is easy to see that both queries
> should return the same result, but the second one misses the shot and
> is corrected as you say.  So, applied.
>
> My apologies for the delay.

My apologies for missing this.  And thank you for taking care!

------
Regards,
Alexander Korotkov





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-16 08:00   ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
@ 2021-04-20 19:07     ` Erik Rijkers <er@xs4all.nl>
  2021-04-20 19:44       ` Re: fix old confusing JSON example Justin Pryzby <pryzby@telsasoft.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Erik Rijkers @ 2021-04-20 19:07 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>

> On 2021.04.16. 10:00 Michael Paquier <michael@paquier.xyz> wrote:
> On Sat, Apr 03, 2021 at 02:28:38PM +0200, Erik Rijkers wrote:
> > So, that gives information on two operators, and then gives one
> > example query for each.  Clearly, the second example was meant to
> > illustrate a where-clause with the  @?  operator. 
> > 
> > Small change to prevent great confusion (I'll admit it took me far
> > too long to understand this). 
> 
> Once one guesses the definition of the table to use with the sample
> data at disposal in the docs, it is easy to see that both queries
> should return the same result, but the second one misses the shot and
> is corrected as you say.  So, applied.

Great, thank you.

I just happened to use the website-documentation and noticed that there the change is not done: it still has the erroneous line, in the docs of 13 (current), and 12; the docs of 14devel are apparently updated.

That makes me wonder: is there a regular html-docs-update (dayly? weekly?) of doc-bugs of this kind in the website-docs of current and earlier releases?

To be clear, I am talking about the lines below:
  'GIN index supports @@ and @? operators'

on pages
  https://www.postgresql.org/docs/13/datatype-json.html
  https://www.postgresql.org/docs/12/datatype-json.html

where the change that was pushed was to correct the second example from  @@  to  @?

thanks,

Erik Rijkers


> 
> My apologies for the delay.
> --
> Michael





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-16 08:00   ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
  2021-04-20 19:07     ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
@ 2021-04-20 19:44       ` Justin Pryzby <pryzby@telsasoft.com>
  2021-04-20 21:08         ` Re: fix old confusing JSON example Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Justin Pryzby @ 2021-04-20 19:44 UTC (permalink / raw)
  To: Erik Rijkers <er@xs4all.nl>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org

On Tue, Apr 20, 2021 at 09:07:52PM +0200, Erik Rijkers wrote:
> I just happened to use the website-documentation and noticed that there the change is not done: it still has the erroneous line, in the docs of 13 (current), and 12; the docs of 14devel are apparently updated.
> 
> That makes me wonder: is there a regular html-docs-update (dayly? weekly?) of doc-bugs of this kind in the website-docs of current and earlier releases?
> 
> To be clear, I am talking about the lines below:
>   'GIN index supports @@ and @? operators'
> 
> on pages
>   https://www.postgresql.org/docs/13/datatype-json.html
>   https://www.postgresql.org/docs/12/datatype-json.html
> 
> where the change that was pushed was to correct the second example from  @@  to  @?

Looking at the doc "HOME", it says:
https://www.postgresql.org/docs/13/index.html
| PostgreSQL 13.2 Documentation

So this seems to be updated for minor releases.

-- 
Justin





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-03 12:28 ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-16 08:00   ` Re: fix old confusing JSON example Michael Paquier <michael@paquier.xyz>
  2021-04-20 19:07     ` Re: fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
  2021-04-20 19:44       ` Re: fix old confusing JSON example Justin Pryzby <pryzby@telsasoft.com>
@ 2021-04-20 21:08         ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-04-20 21:08 UTC (permalink / raw)
  To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: Erik Rijkers <er@xs4all.nl>; Michael Paquier <michael@paquier.xyz>; pgsql-hackers@lists.postgresql.org

Justin Pryzby <pryzby@telsasoft.com> writes:
> On Tue, Apr 20, 2021 at 09:07:52PM +0200, Erik Rijkers wrote:
>> I just happened to use the website-documentation and noticed that there the change is not done: it still has the erroneous line, in the docs of 13 (current), and 12; the docs of 14devel are apparently updated.
>> 
>> That makes me wonder: is there a regular html-docs-update (dayly? weekly?) of doc-bugs of this kind in the website-docs of current and earlier releases?

> Looking at the doc "HOME", it says:
> https://www.postgresql.org/docs/13/index.html
> | PostgreSQL 13.2 Documentation
> So this seems to be updated for minor releases.

Yeah.  The website's copy of the devel version of the docs is refreshed
quickly (within a few hours of commit, usually) but released branches
are only updated when there's a release.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: fix old confusing JSON example
  2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
@ 2021-04-03 12:32 ` Michael Paquier <michael@paquier.xyz>
  1 sibling, 0 replies; 8+ messages in thread

From: Michael Paquier @ 2021-04-03 12:32 UTC (permalink / raw)
  To: Erik Rijkers <er@xs4all.nl>; +Cc: Postgres docs <pgsql-docs@lists.postgresql.org>

On Sat, Apr 03, 2021 at 02:01:38PM +0200, Erik Rijkers wrote:
> Attached is a small but confusing mistake in the json documentation
> (a @@ instead of @?) that has been there since version 12.  (It took
> me quite some time to figure that out while testing with the recent
> SQL/JSON patches -- which I initially blamed).

Please note that pgsql-committers is the mailing list with emails
generated automatically for each commit done in the main repository.
For anything related to the docs, pgsql-docs is more adapted, so I am
redirecting this thread there.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2021-04-20 21:08 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03 12:01 fix old confusing JSON example Erik Rijkers <er@xs4all.nl>
2021-04-03 12:28 ` Erik Rijkers <er@xs4all.nl>
2021-04-16 08:00   ` Michael Paquier <michael@paquier.xyz>
2021-04-16 14:25     ` Alexander Korotkov <aekorotkov@gmail.com>
2021-04-20 19:07     ` Erik Rijkers <er@xs4all.nl>
2021-04-20 19:44       ` Justin Pryzby <pryzby@telsasoft.com>
2021-04-20 21:08         ` Tom Lane <tgl@sss.pgh.pa.us>
2021-04-03 12:32 ` Michael Paquier <michael@paquier.xyz>

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