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.96) (envelope-from ) id 1wl51h-0011tM-25 for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jul 2026 13:24:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wl50f-0034V9-0e for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jul 2026 13:23:17 +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.96) (envelope-from ) id 1wl0ag-0031XZ-2d for pgsql-bugs@lists.postgresql.org; Sat, 18 Jul 2026 08:40:10 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wl0ad-00000000tq2-1MAO for pgsql-bugs@lists.postgresql.org; Sat, 18 Jul 2026 08:40:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=mA3JGQIhqXiK0Yz4TLEDcLkXft2crrAIzxynFXaskxA=; b=Ho7GLDQ0K/ppR+QQIrSYl7thy0 pL5olI7QEaJ9Bbbxbyb+l2YYkaPewlqPpczzexxxu1zE1BTVV55t83zDlWu4vFkhtxVuwbTuswhIo cJ4ub6BVQJEBUNbKzmqOoz4bsgdntyMotl8OMZtz4v0nUGrimFVr2XpL6TIFK1SDeSu9vjfzv0gp0 +C2xuTjdBLKvvEhACldy0jtgbSidCOl/XAJEsEw7wyUkpob6VPldJwZ0q2EMHlmIa/oAJchsqnkdn 29bZ1FSulv6QJxkYi7kZPkP0dboQ9c2/gfshx4TlsAW+fFOecWwclsozD8TV6egTQgkZ+Sdif7b4T KOK0DQcw==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wl0aa-002PxA-34 for pgsql-bugs@lists.postgresql.org; Sat, 18 Jul 2026 08:40:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wl0aY-005dEk-0M for pgsql-bugs@lists.postgresql.org; Sat, 18 Jul 2026 08:40:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19558: User-defined prefix operators "|" and "->" no longer parse in 19beta2 (SQL/PGQ grammar change) To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: pierre@senellart.com Reply-To: pierre@senellart.com, pgsql-bugs@lists.postgresql.org Date: Sat, 18 Jul 2026 08:39:10 +0000 Message-ID: <19558-ad1fca59a3a471a0@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19558 Logged by: Pierre Senellart Email address: pierre@senellart.com PostgreSQL version: 19beta2 Operating system: Linux Description: =20 The following works on PostgreSQL <=3D 18 but raises a syntax error on 19beta1/19beta2 (tested: PostgreSQL 19beta2, Ubuntu package 19~beta2-1.pgdg26.04+1, x86_64-linux): CREATE FUNCTION identity_int(int) RETURNS int LANGUAGE sql IMMUTABLE AS 'SELECT $1'; CREATE OPERATOR | (RIGHTARG =3D int, FUNCTION =3D identity_int); CREATE OPERATOR -> (RIGHTARG =3D int, FUNCTION =3D identity_int); SELECT | 5; -- 18: returns 5; 19beta2: syntax error at or near "|" SELECT -> 5; -- 18: returns 5; 19beta2: syntax error at or near "->" Cause: the SQL/PGQ property graph patch turned "|" and "->" into dedicated grammar tokens (RIGHT_ARROW), declared in the precedence list alongside Op. Explicit binary productions (a_expr '|' a_expr, a_expr RIGHT_ARROW a_expr) preserve infix use, and both tokens were added to the operator-name productions, so binary use and the OPERATOR() syntax still work: SELECT OPERATOR(public.|) 5; -- still returns 5 on 19beta2 SELECT OPERATOR(public.->) 5; -- still returns 5 on 19beta2 But no unary counterparts of these productions were added, so a user-defined *prefix* operator spelled exactly "|" or "->" can no longer be invoked by its bare name. Note the inconsistency: CREATE OPERATOR still accepts both names for prefix operators; the resulting operator just cannot be called except through OPERATOR(). If the tokenization is here to stay, could unary productions ('|' a_expr, RIGHT_ARROW a_expr) be added to restore the pre-19 behaviour? Failing that, this seems worth an entry in the release notes' incompatibilities section, since nothing currently documents it. Motivation: https://pgxn.org/dist/provsql/ which I am developing uses prefix | as a probabilistic =E2=80=9Cgiven=E2=80=9D operator. This works on all Po= stgreSQL versions from 10 to 18, but fails on 19beta2.