Re: [PATCHES] ruleutils with pretty-print option

2003-07-31 Thread Andreas Pflug
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

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

2003-07-31 Thread Andreas Pflug
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

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

2003-07-31 Thread Andreas Pflug
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

Re: [PATCHES] ruleutils with pretty-print option

2003-07-31 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I didn't like the functions ending in _ext. I renamed them to _pp for pretty print. Patch attached and applied. Seems to be shy a catversion bump; since you have just made an incompatible change in the internal-function-names

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

2003-07-31 Thread Tom Lane
Andreas Pflug [EMAIL PROTECTED] writes: Well, to me it's not well-known that floating-point addition is not associative, do I need to re-learn my math? regression=# select (1.0::float8 + (-1.0::float8)) + 1.0e-20::float8; ?column? -- 1e-20 (1 row) regression=# select 1.0::float8

Re: [PATCHES] ruleutils with pretty-print option

2003-07-31 Thread Bruce Momjian
Would you send over the patch --- it was missing. --- Andreas Pflug wrote: Tom Lane wrote: Applied with some editorializing. In particular, I don't believe the original did the right thing with (a - (b - c)).

Re: [PATCHES] ruleutils with pretty-print option

2003-07-30 Thread Bruce Momjian
I didn't like the functions ending in _ext. I renamed them to _pp for pretty print. Patch attached and applied. --- Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: I recoded the stuff as Tom recommended,

Re: [PATCHES] ruleutils with pretty-print option

2003-07-30 Thread Bruce Momjian
Patch applied, modified by Tom and myself. --- Andreas Pflug wrote: Bruce Momjian wrote: Andreas, looks good, but I need a diff -c, context diff. Hi Bruce, I intentionally only attached only non-context diffs

Re: [PATCHES] ruleutils with pretty-print option

2003-07-28 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: + int prettyFlags = !PG_ARGISNULL(1) PG_GETARG_BOOL(1) ? PRETTYFLAG_PAREN|PRETTYFLAG_INDENT : 0; Since the pg_proc entries are all marked strict, it's unnecessary for you to write any ARGISNULL checks. Yeah you're

Re: [PATCHES] ruleutils with pretty-print option

2003-07-27 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Are these illustrating a problem with the function definition, or is it happening because it is the first time we are calling the same function with one and more than one parameter? The function definition is broken. While it could

Re: [PATCHES] ruleutils with pretty-print option

2003-07-27 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tom, how do I pass PG_FUNCTION_ARGS to another function, while adding a new parameter? I wouldn't. Do the PG_GETARGS in the wrapper, and have the called function take a normal C parameter list. regards, tom lane

Re: [PATCHES] ruleutils with pretty-print option

2003-07-27 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom, how do I pass PG_FUNCTION_ARGS to another function, while adding a new parameter? I wouldn't. Do the PG_GETARGS in the wrapper, and have the called function take a normal C parameter list. So I need to wrappers for each

Re: [PATCHES] ruleutils with pretty-print option

2003-07-27 Thread Andreas Pflug
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom, how do I pass PG_FUNCTION_ARGS to another function, while adding a new parameter? I wouldn't. Do the PG_GETARGS in the wrapper, and have the called function take a normal C parameter list. So I

Re: [PATCHES] ruleutils with pretty-print option

2003-07-22 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --- Andreas Pflug wrote: Bruce Momjian

Re: [PATCHES] ruleutils with pretty-print option

2003-07-22 Thread Bruce Momjian
Andreas Pflug wrote: Bruce Momjian wrote: Andreas, looks good, but I need a diff -c, context diff. Hi Bruce, I intentionally only attached only non-context diffs because the patch is about 50 % size of the original file. Now, here's the same as context diff. I understand. I

Re: [PATCHES] ruleutils with pretty-print option

2003-07-21 Thread Andreas Pflug
Hi Bruce, so here's the complete patch against the current cvs. Description: The attached patches will add pg_get_ruledef(oid, bool) pg_get_viewdef(text, bool) pg_get_viewdef(oid, bool) pg_get_indexdef(oid, int4, bool) pg_get_constraintdef(oid, bool) pg_get_expr(text, oid, bool) If the

Re: [PATCHES] ruleutils with pretty-print option

2003-07-21 Thread Bruce Momjian
Andreas, looks good, but I need a diff -c, context diff. --- Andreas Pflug wrote: Hi Bruce, so here's the complete patch against the current cvs. Description: The attached patches will add pg_get_ruledef(oid,