agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Pierre Forstmann <pierre.forstmann@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pierre@senellart.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: [patch] BUG #19558: User-defined prefix operators "|" and "->" no longer parse in 19beta2 (SQL/PGQ grammar change)
Date: Sat, 18 Jul 2026 18:01:48 +0200
Message-ID: <1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com> (raw)
In-Reply-To: <11151.1784389359@sss.pgh.pa.us>
References: <19558-ad1fca59a3a471a0@postgresql.org>
<02aea982-c656-462d-a412-1fb2e388f754@gmail.com>
<11151.1784389359@sss.pgh.pa.us>
No good reason: I have fixed my mistake in patch v002.
Thanks.
Le 18/07/2026 à 17:42, Tom Lane a écrit :
> Pierre Forstmann <pierre.forstmann@gmail.com> writes:
>> I propose following patch that adds missing grammar rules:
> Why are you promoting these to UMINUS binding precedence?
> AFAICS they would have had Op precedence before v19
> (and still do, as binary operators).
>
> regards, tom lane
Attachments:
[text/x-patch] 0002-bug-19558-Fix-user-defined-prefix-operators-and-fixe.patch (1.5K, ../1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com/2-0002-bug-19558-Fix-user-defined-prefix-operators-and-fixe.patch)
download | inline diff:
From 8481b482ab23fee014d3a0277a275749990f19a9 Mon Sep 17 00:00:00 2001
From: Pierre Forstmann <pierre.forstmann@gmail.com>
Date: Sat, 18 Jul 2026 17:53:55 +0200
Subject: [PATCH 2/2] bug#19558: Fix user-defined prefix operators '|' and
'->': fixed %prec
---
src/backend/parser/gram.y | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 331da79..071bbf2 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -15873,9 +15873,9 @@ a_expr: c_expr { $$ = $1; }
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2, @1); }
| '-' a_expr %prec UMINUS
{ $$ = doNegate($2, @1); }
- | '|' a_expr %prec UMINUS
+ | '|' a_expr %prec Op
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "|", NULL , $2, @1); }
- | RIGHT_ARROW a_expr %prec UMINUS
+ | RIGHT_ARROW a_expr %prec Op
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "->", NULL , $2, @1); }
| a_expr '+' a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3, @2); }
@@ -15905,8 +15905,6 @@ a_expr: c_expr { $$ = $1; }
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "->", $1, $3, @2); }
| a_expr '|' a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "|", $1, $3, @2); }
-
-
| a_expr qual_Op a_expr %prec Op
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $2, $1, $3, @2); }
| qual_Op a_expr %prec Op
--
2.52.0
view thread (5+ messages) latest in thread
Message-ID: <1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com>
Permalink: ../1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com/
Also on: postgresql.org/message-id/1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: pierre.forstmann@gmail.com, tgl@sss.pgh.pa.us, pierre@senellart.com, pgsql-bugs@lists.postgresql.org
Subject: Re: [patch] BUG #19558: User-defined prefix operators "|" and "->" no longer parse in 19beta2 (SQL/PGQ grammar change)
In-Reply-To: <1b69cad1-19b4-4334-bb6e-a343151e8b78@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox