Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSfON-0002N5-E8 for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Apr 2021 12:28:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lSfOM-0006rE-5t for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Apr 2021 12:28:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSfOL-0006r7-VT for pgsql-hackers@lists.postgresql.org; Sat, 03 Apr 2021 12:28:41 +0000 Received: from lb3-smtp-cloud8.xs4all.net ([194.109.24.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSfOJ-0003zk-LJ for pgsql-hackers@lists.postgresql.org; Sat, 03 Apr 2021 12:28:41 +0000 Received: from ox-appsuite1.xs4all.net ([194.109.29.134]) by smtp-cloud8.xs4all.net with ESMTPSA id SfOIlwJ4BgIC3SfOIlzAgr; Sat, 03 Apr 2021 14:28:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1617452918; bh=5t+KLc5WJAVrYBgo0Iwkdupfur49/YExL5GNZdr1TK4=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:From: Subject; b=nvdtDdyO3dPx3E7DnF3xWkMCsqGYXajQTWTIdc6ndeW6uxPo53Biw77LvjmwMXT8L g6BQF0bUEsYq+6dn9rxE8SynNHVuLlbrHJc2/pmWjBfvTrMFuwpbgaACrelDP7jLFb oCDyLKaH5jLuiLdugyfc4lXZPKPORjb6BmsKoIHG5+LTLlH1C9jNWiWLxrRV6wl/rE zQDj5TZkjogFZrCivm2+JyQIJR8USLAUk6ImLz8RwYxVu/cOuowYcCeqZwa8thXIXF 7NC2gUSvPirtqs6ogMh8gu462E5xT4McrnxEHsPM7IWRKP+da931VWwcKEyKbp51tV DGOa8WutS+mUQ== Date: Sat, 3 Apr 2021 14:28:38 +0200 (CEST) From: Erik Rijkers To: "pgsql-hackers@lists.postgresql.org" Message-ID: <1219476687.20432.1617452918468@webmailclassic.xs4all.nl> In-Reply-To: <1409005792.20330.1617451298469@webmailclassic.xs4all.nl> References: <1409005792.20330.1617451298469@webmailclassic.xs4all.nl> Subject: Re: fix old confusing JSON example MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_20431_1959837399.1617452918464" X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.4-Rev16 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfIawCx7UYM2IaJlEE0DADfAH50v+N+SsnWFfOE2XNZX7GuT+F/9uWveOoWkH1SaLlYF4LSivden3ilXR6vcK8Mmqpcb748SujdAi3onOoufJdYKFi064 WSh4nMp+WtMNKcdkN3iTRigdhMWm1sysDMjEeMtHlIa06Aft44R2w7pUdqhqMn6qnkVJJ9LqBKHgjDhXIc7CR2O8qxD5eN0tR+M= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_20431_1959837399.1617452918464 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > On 2021.04.03. 14:01 Erik Rijkers 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 ------=_Part_20431_1959837399.1617452918464 Content-Type: text/x-patch; charset=ISO-8859-1; name=json.sgml.20210403.diff Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=json.sgml.20210403.diff X-Part-Id: fec1d9d697ea48118ea30a0444407d6f LS0tIGRvYy9zcmMvc2dtbC9qc29uLnNnbWwub3JpZwkyMDIxLTA0LTAzIDEzOjQ3OjI5LjQ4NDUx MDkzNiArMDIwMAorKysgZG9jL3NyYy9zZ21sL2pzb24uc2dtbAkyMDIxLTA0LTAzIDEzOjQ3OjUz LjAyODg2Njc1MiArMDIwMApAQCAtNDg5LDcgKzQ4OSw3IEBACiBTRUxFQ1QgamRvYy0+J2d1aWQn LCBqZG9jLT4nbmFtZScgRlJPTSBhcGkgV0hFUkUgamRvYyBAQCAnJC50YWdzWypdID09ICJxdWki JzsKIDwvcHJvZ3JhbWxpc3Rpbmc+CiA8cHJvZ3JhbWxpc3Rpbmc+Ci1TRUxFQ1QgamRvYy0+J2d1 aWQnLCBqZG9jLT4nbmFtZScgRlJPTSBhcGkgV0hFUkUgamRvYyBAQCAnJC50YWdzWypdID8gKEAg PT0gInF1aSIpJzsKK1NFTEVDVCBqZG9jLT4nZ3VpZCcsIGpkb2MtPiduYW1lJyBGUk9NIGFwaSBX SEVSRSBqZG9jIEA/ICckLnRhZ3NbKl0gPyAoQCA9PSAicXVpIiknOwogPC9wcm9ncmFtbGlzdGlu Zz4KICAgICBHSU4gaW5kZXggZXh0cmFjdHMgc3RhdGVtZW50cyBvZiBmb2xsb3dpbmcgZm9ybSBv dXQgb2YKICAgICA8bGl0ZXJhbD5qc29ucGF0aDwvbGl0ZXJhbD46IDxyZXBsYWNlYWJsZT5hY2Nl c3NvcnNfY2hhaW48L3JlcGxhY2VhYmxlPiA9IDxyZXBsYWNlYWJsZT5jb25zdDwvcmVwbGFjZWFi bGU+Lgo= ------=_Part_20431_1959837399.1617452918464--