pgsql: Restore the ability to use | and -> as prefix operators.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Restore the ability to use | and -> as prefix operators.
Date: 2026-07-18 16:57:49
Message-ID: E1wl8MG-000nYg-25@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Restore the ability to use | and -> as prefix operators.

Commit 2f094e7ac changed the parser to treat these as built-in
operator names, where before they were just generic Op. While
it correctly gave them the same precedence as Op and added new
productions to allow them to still be used as infix operators,
it missed allowing them to still be used as prefix operators.
At least one extension expects to be able to do that, so add
the necessary productions.

Bug: #19558
Reported-by: Pierre Senellart <pierre(at)senellart(dot)com>
Author: Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/19558-ad1fca59a3a471a0@postgresql.org
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8d2beee027af41a6b66c670b6a595895f24a1bb0

Modified Files
--------------
src/backend/parser/gram.y | 8 ++++++++
1 file changed, 8 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-07-18 18:09:27 pgsql: Fix edge case in remove_useless_result_rtes() with outer joins.
Previous Message Jeff Davis 2026-07-18 16:27:53 pgsql: Fix REASSIGN OWNED for subscriptions in other databases.