Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIWBU-00GAnf-4U for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 16:23:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sIWBR-00F6JA-On for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 16:23:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIWBR-00F6J2-Cg for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 16:23:18 +0000 Received: from 008.lax.mailroute.net ([199.89.1.11]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIWBO-001p8w-E1 for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 16:23:17 +0000 Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4W1hJw1b3tz6Cnk97; Sat, 15 Jun 2024 16:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mr01; t= 1718468590; x=1721060591; bh=TD26Zx4/TSvspOLyofQam8444neYXwRE/t8 jAJWSno8=; b=Lw6w376cGxxbC+Gt0KB2nSiHm9p270LL5UzvX6XH05mk2XCUG7k KIbbbCZWuBa9zA+HGn/6QNymvgNoJ8qTeftGOuIABkW1fAAFkE3CsFc1Uq93gDfT C/3tiGx8t8fXP7yzyR023B+E7VYS+0m+kYRc2xhegHUki/42jjWyDS4GOYJ6RIou mu6g6dLoVad8SQx0vjDIoo9SOqQINeMlQ32sQIxI14QglxYCBXC91gfgaOasV9Qf HPMM9ScdK6KsYvRtz4w7b/J52i6DjI6IO6wumE68uOVkgtfD06cgQSFb1oddX+Qf 6rMi0zIKUEUPVLQCofo2K6ZLvvfqb/E1dfA== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id FuUHklUhlk0G; Sat, 15 Jun 2024 16:23:10 +0000 (UTC) Received: from [73.103.120.3] (c-73-103-120-3.hsd1.in.comcast.net [73.103.120.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jcflack@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4W1hJt212Lz6Cnk95; Sat, 15 Jun 2024 16:23:09 +0000 (UTC) Subject: Re: jsonpath: Missing regex_like && starts with Errors? To: "David E. Wheeler" References: <9272D3A9-8805-4DE1-A95F-84EB210EC121@justatheory.com> <666CFC8E.1000108@acm.org> Cc: PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <666DBFEC.70201@acm.org> Date: Sat, 15 Jun 2024 12:23:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06/15/24 10:47, David E. Wheeler wrote: > these are predicate check expressions, supported and documented > as an extension to the standard since Postgres 12[1]. > ... > [1]: https://www.postgresql.org/docs/devel/functions-json.html#FUNCTION= S-SQLJSON-CHECK-EXPRESSIONS I see. Yes, that documentation now says "predicate check expressions retu= rn the single three-valued result of the predicate: true, false, or unknown"= . (Aside: are all readers of the docs assumed to have learned the habit of calling SQL null "unknown" when speaking of a boolean? They can flip back to 8.6 Boolean Type and see 'a third state, =E2=80=9Cunknown=E2=80=9D= , which is represented by the SQL null value'. But would it save them some page flipping to add " (represented by SQL null)" to the sentence here?) As Unknown is typically what the predicates return within a filter (where errors get trapped) when an error has occurred, the existing docs seem to suggest they behave the same way in a "predicate check expression", so a change to that behavior now would be a change to what we've documented. OTOH, getting Unknown because some error occurred is strictly less information than seeing the error, so perhaps you would want a way to request non-error-trapping behavior for a "predicate check expression"= . Can't really overload jsonb_path_query's 'silent' parameter for that, because it is already false by default. If predicate check expressions were nonsilent by default, the existing 'silent' parameter would be a perfect way to silence them. No appetite to add yet another optional boolean parameter to jsonb_path_query for the sole purpose of controlling the silence of our nonstandard syntax extension .... Maybe just see the nonstandard syntax extension and raise it another one: expr_or_predicate : expr | predicate | "nonsilent" '(' predicate ')' ; or something like that. Regards, -Chap