Re: [Fwd: Re: ruleutils with pretty-print option]

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [Fwd: Re: ruleutils with pretty-print option]
Date: 2003-07-31 14:30:17
Message-ID: 3F2927F9.6080402@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>>Now the patch is *really* appended :-)
>>
>>
>
>And rejected.
>
Ok, the ckeck for node being the first child already does the trick for
standard l-t-r evaluation.

>You cannot assume that an operator is commutative or
>associative just because it has a name you think ought to be.
>(For a counter-example, it's well known that floating-point addition
>is not associative.)
>
Well, to me it's not well-known that floating-point addition is not
associative, do I need to re-learn my math?

>More: if the tree structure for ops of equal precedence looks like
>a + (b + c), then it's a near certainty that the user wrote those
>parentheses. Why would you think that removing them is pretty-printing?
>
In this case the user really wrote the parentheses, so they should be shown.
This stuff is all about guessing what the original definition looked
like, if we just had the source <sigh>...
I had a conversation with Bruce about embedded comments, and we found
that the idea of (mis-)using nodes for this seems to be not viable.
Still seeking for a way to preserve more-or-less the original user's
definition.

Regards,
Andreas

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-07-31 14:34:03 Re: updateable cursors
Previous Message Tom Lane 2003-07-31 14:05:25 Re: Check for failed memory allocations in libpq