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 1pjiLH-0006zd-QA for pgsql-general@arkaria.postgresql.org; Tue, 04 Apr 2023 15:13:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjiLG-000661-Gw for pgsql-general@arkaria.postgresql.org; Tue, 04 Apr 2023 15:13:02 +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 1pjiLF-00064N-D6 for pgsql-general@lists.postgresql.org; Tue, 04 Apr 2023 15:13:02 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pjiLB-000qtm-9C for pgsql-general@lists.postgresql.org; Tue, 04 Apr 2023 15:13:00 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D90F33200944; Tue, 4 Apr 2023 11:12:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 04 Apr 2023 11:12:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1680621174; x=1680707574; bh=gYxmBbmkjahtMNgoIXE3mj6HVCoE8v3cl0C MxTrsnvY=; b=fiEe/ZFQwb0F05oTJXX9azYelrvo9fuhTkzBi14PAko+SsUl7Iz qQ0xgV8zBdSLrmq29tUXevKewc3NEr1kotI+K2NWVtvxwsWrVdupijsZTAaWVJ3a q5PYbIU/4ZRTdvCEgAfUK+T4kK87nprE2n4YXanIODjpjcbc/i+yowmTY4YxVGYj vPX1AH7HX6L0ATf+4ZYeP18G9AGvD21rSMBPsdCPe6iLiybsM/0JNsdAsIOFTdf0 RCgScA3eLykMVNZ+wkauaDkq/2dZY1ucJhewP7/reE5ML6Sr7A8lzYx6yrI06NIZ 6fzglHAXl7fUBqq3Cfh+gsbu15BzUmGQGcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1680621174; x=1680707574; bh=gYxmBbmkjahtMNgoIXE3mj6HVCoE8v3cl0C MxTrsnvY=; b=qIMpJsDr8fP3jxQUpWIyT47NAPf119Tzgs7ID/4pL0T9ntZLiN+ l2UwcPgBy4zLfxIlx/xGkkRKcXbb/YS23m7d49QOM5Iotnr1x4WKxvX00W/h2eVM wiEaVQXXkYxlfEnLEwSyem7HpL0yLAFu1SMQxrPWivdhMJO/uZUr+739AgXciZn7 CrpW73e+8fHTBfYfc+sZuc7tJ88PcY8doKTdXLd2XpKviD1Y1NphAp3VfgGb/lXo b6850ChpEYtFQLxO6fv7ykDcqzFWonEzxsmSmDCp+2+lZQIuERzKQoqoB+Nc5f5h i32pk3ZEVkEUkaZgkce2/I+vXHcWr1fFVqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiledgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepjeegtdfhuefhtefgffdvheduleetgeejudevffek teegjeeiheeuudellefgffffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Apr 2023 11:12:53 -0400 (EDT) Message-ID: <985e55f9-0619-5ee9-ae87-b8d5248cb8a7@aklaver.com> Date: Tue, 4 Apr 2023 08:12:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: =?UTF-8?B?UmU6IOKAi2pzb25iIEBAIGpzb25wYXRoIG9wZXJhdG9yIGRvYzog4oCL?= =?UTF-8?Q?Only_the_first_item_of_the_result_is_taken_into_account?= To: Erik Wienhold , jian he Cc: pgsql-general list References: <202761461.525027.1680441711777@office.mailbox.org> <48ed779b-c405-ca4f-c2d1-5ecc0312d9a3@aklaver.com> <550248534.555107.1680534677029@office.mailbox.org> <2f804410-376e-fc69-1829-71d4be49e39c@aklaver.com> <1597721260.560673.1680538908417@office.mailbox.org> <880194083.579916.1680598906819@office.mailbox.org> Content-Language: en-US From: Adrian Klaver In-Reply-To: <880194083.579916.1680598906819@office.mailbox.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/4/23 02:01, Erik Wienhold wrote: >> On 04/04/2023 03:50 CEST jian he wrote: >> >>> "Returns true if any JSON value at the given path matches the predicate. >>> Returns NULL when not a path predicate or comparing different types." >> >> in first sentence, should we add something "otherwise return false." ? > > I omitted the "otherwise false" part because of the corner cases which I did > not want to gloss over. But the corner cases also apply if the predicate > matches some value, depending on strict mode, as I noticed later and wrote in > my previous message. > > Suggestion: > > "Returns true if any JSON value at the given path matches the predicate, > otherwise returns false. Unless the predicate compares different types > (depending on strict mode) or the jsonpath is not a path predicate, in > which case NULL is returned." That I understand. Thanks. > > I guess it's best to document the corner cases in detail in the notes section > as Adrian pointed out and have the function doc refer to the notes. > >> also, should it be "Return true"? (since only one value returned)? > > The third-person singular "returns" is correct in this case. It does not refer > to the number of returned values. > > -- > Erik -- Adrian Klaver adrian.klaver@aklaver.com