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 1sIJzR-00Ej3U-Qp for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 03:22:05 +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 1sIJzO-009HAJ-PP for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jun 2024 03:22:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIJzO-009HAB-AV for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 03:22:03 +0000 Received: from 008.lax.mailroute.net ([199.89.1.11]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sIJzI-001NDW-Aq for pgsql-hackers@lists.postgresql.org; Sat, 15 Jun 2024 03:22:01 +0000 Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4W1LzR1s8Vz6CmQwQ; Sat, 15 Jun 2024 03:21:55 +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= 1718421714; x=1721013715; bh=5cxQbGPnXMlBnrbvRjcNb+gsAdVFdSFf8xd bti1YZ/Q=; b=AwvO7Wf4HAtgj2X5EIGTITF71k7lLo4/USGPPgleHmt8aNLvgnC QPh2eODy3f8gjkWoEut886kx6pD/MqC/glekqt/pX/lWHH8xXY6Fc3StQEFWZdOr 1M6QFTHbpsqIOFKMteIZmYqpiIKgN1JbvhTciTlmnyt+THtQ50kysZZxML0VqDr5 IkGsmcIY4bsBiCZefeJkw0xCfLGrS+zJ9ZcpvwEjA40XGvPQX8QhEns8Sbsj2gVk gFmh20bUoiSP44/XqLXZGiPcrXYalCOdT5zcnLdjKI4y4esXZEOCxySNzwJbIyr0 Lq4GVJn78l0jkUe3iq6O7tyQZK6kXlONA2A== 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 PpkJSbY8qZMp; Sat, 15 Jun 2024 03:21:54 +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 4W1LzP6XvYz6CmR5y; Sat, 15 Jun 2024 03:21:53 +0000 (UTC) Subject: Re: jsonpath: Missing regex_like && starts with Errors? To: "David E. Wheeler" , PostgreSQL Hackers References: <9272D3A9-8805-4DE1-A95F-84EB210EC121@justatheory.com> <666CFC8E.1000108@acm.org> From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <666D08D0.1020204@acm.org> Date: Fri, 14 Jun 2024 23:21:52 -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: <666CFC8E.1000108@acm.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06/14/24 22:29, Chapman Flack wrote: > So I should go look at our code to see what grammar we've implemented, > exactly. It is beginning to seem as if we have simply added > as another choice for an expression, not restricted > to only appearing in a filter. If so, and we add documentation about how > we diverge from the standard, that's probably the way to say it. That's roughly what we've done: 119 result: 120 mode expr_or_predicate { 121 ... 125 } 126 | /* EMPTY */ { *result = NULL; } 127 ; 128 129 expr_or_predicate: 130 expr { $$ = $1; } 131 | predicate { $$ = $1; } 132 ; Oddly, that's only at the top-level goal production. Your entire JSON path query we'll allow to be a predicate in lieu of an expr. We still don't allow a predicate to appear in place of an expr within any other production. Regards, -Chap