[Fwd: Re: ruleutils with pretty-print option] - Mailing list pgsql-patches

From Andreas Pflug
Subject [Fwd: Re: ruleutils with pretty-print option]
Date
Msg-id 3F28E366.3080800@pse-consulting.de
Whole thread Raw
Responses Re: [Fwd: Re: ruleutils with pretty-print option]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Now the patch is *really* appended :-)

Tom Lane wrote:

>
>Applied with some editorializing.  In particular, I don't believe the
>original did the right thing with (a - (b - c)).
>
>
>

Oops, missed that case...
But now, we have (a + ( b + c)) again.
A patch that removes parentheses for + and * is appended.

Regards,
Andfdsa


Index: backend/utils/adt/ruleutils.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/ruleutils.c,v
retrieving revision 1.147
diff -c -r1.147 ruleutils.c
*** backend/utils/adt/ruleutils.c    30 Jul 2003 22:56:23 -0000    1.147
--- backend/utils/adt/ruleutils.c    31 Jul 2003 09:32:15 -0000
***************
*** 2547,2552 ****
--- 2547,2559 ----
                  if (node == (Node *) lfirst(((OpExpr *) parentNode)->args))
                      return true;

+                 /*
+                                  * Exception: for * and +, ordering doesn't matter
+                                  */
+                 if ((*op == '+' && *parentOp == '+') ||
+                     (*op == '*' && *parentOp == '*'))
+                     return true;
+
                  return false;
              }
              /* else do the same stuff as for T_SubLink et al. */

pgsql-patches by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: ruleutils with pretty-print option
Next
From: Manfred Koizar
Date:
Subject: Re: Proof-of-concept for initdb-time shared_buffers selection