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 1taI0w-000TBq-No for pgsql-docs@arkaria.postgresql.org; Tue, 21 Jan 2025 17:26:11 +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 1taI0v-002JPx-Lu for pgsql-docs@arkaria.postgresql.org; Tue, 21 Jan 2025 17:26:09 +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 1taI0v-002JPo-Ey for pgsql-docs@lists.postgresql.org; Tue, 21 Jan 2025 17:26:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taI0q-000lTb-2A for pgsql-docs@lists.postgresql.org; Tue, 21 Jan 2025 17:26:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 50LHQ3nE3358481; Tue, 21 Jan 2025 12:26:03 -0500 From: Tom Lane To: mohamedhussein10445@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Request for Formal Syntax of WHERE Clause Conditions In-reply-to: <173747531931.1071.13547694511760149052@wrigleys.postgresql.org> References: <173747531931.1071.13547694511760149052@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Tue, 21 Jan 2025 16:01:59 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3358479.1737480363.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 21 Jan 2025 12:26:03 -0500 Message-ID: <3358480.1737480363@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form writes: > I am building a PostgreSQL parser and need a precise reference for the > formal syntax of condition used in the WHERE clause. We do not have one. You might be able to extract what you need from our Bison grammar though: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dblob;f=3Dsrc/bac= kend/parser/gram.y;h=3Dd7f9c00c4099bd86c39ce79c997123a2a0ca6782;hb=3DHEAD starting more or less from the a_expr production. Keep in mind that this is a moving target, as we frequently add new syntax features. regards, tom lane