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 1sJL5n-004Lpq-Sh for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jun 2024 22:44:51 +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 1sJL5l-004leu-Fl for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jun 2024 22:44:50 +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 1sJL5l-004lem-2X for pgsql-hackers@lists.postgresql.org; Mon, 17 Jun 2024 22:44:50 +0000 Received: from 009.lax.mailroute.net ([199.89.1.12]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJL5i-002BwI-P5 for pgsql-hackers@lists.postgresql.org; Mon, 17 Jun 2024 22:44:49 +0000 Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4W34hD1v1kzlgMVP; Mon, 17 Jun 2024 22:44:44 +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= 1718664283; x=1721256284; bh=AhAqNoZVBhu9r8iT2fJTCkj1PLajE1NsZ7h U2VqWoCs=; b=0slE15wmzRK70wB09IiI1o85JnjQoVedF4mKh05rpEYWljg/qN4 0hj0YqMfv6BVYDICyk+jnzvE/6UiBjVNHMroqigSKg/98us+sxp/h5/UX97d8sj0 oNvPmVnC1TVbUW6GQ1gFgOVjGjCMjl6hg8H1kGxVhXVFxt9AdM/Y1JGFh/wn58kP ReqSGm78m4WxwhV3jdFmEQHyBkBOL5ZPeBnjNKWPJ+H2WZeazmEEIa8X5bU9Bnlq URTvkwzg03QFQrJq/aYKcwk5CQXkx8mVgfaxrKGreLCHR5KVOge0VKuZifUbvXUU uglTI8rXhmZZHMpFXWRMnpDvbhIsrepzyVg== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id WAOsOSJjbkPW; Mon, 17 Jun 2024 22:44:43 +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 009.lax.mailroute.net (Postfix) with ESMTPSA id 4W34hB5w64zlgMVL; Mon, 17 Jun 2024 22:44:42 +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> <666DBFEC.70201@acm.org> <9BAFB50F-267E-4078-9558-36155E93A723@justatheory.com> Cc: PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <6670BC59.1010204@acm.org> Date: Mon, 17 Jun 2024 18:44:41 -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: <9BAFB50F-267E-4078-9558-36155E93A723@justatheory.com> 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/17/24 18:14, David E. Wheeler wrote: > So I think that=E2=80=99s the key: There=E2=80=99s not a difference bet= ween the behavior of > `like_regex` and `starts with` vs other predicate expressions. The current implementation seems to have made each of our s responsible for swallowing its own errors, which is one perfectly cromulent way to satisfy the SQL standard behavior sayin= g all errors within a should be swallowed. The standard says nothing on how they should behave outside of a , because as far as the standard's concerned, they can't appear there. Ours currently behave the same way, and swallow their errors. It would have been possible to write them in such a way as to raise error= s, but not when inside a , and that would also satis= fy the standard, but it would also give us the errors you would like from ou= r nonstandard "predicate check expressions". And then you could easily use silent =3D> true if you wanted them silent. I'd be leery of changing that, though, as we've already documented that a "predicate check expression" returns true, false, or unknown, so having it throw by default seems like a change of documented behavior. The current situation can't make much use of 'silent', since it's already false by default; you can't make it any falser to make predicate-check errors show up. Would it be a thinkable thought to change the 'silent' default to null? That could have the same effect as false for SQL standard expressions, an= d the same effect seen now for "predicate check expressions", and you could pass it explicitly false if you wanted errors from the predicate checks. If that's no good, I don't see an obvious solution other than adding another nonstandard construct to what's nonstandard already, and allowing something like nonsilent(predicate check expression). Regards, -Chap