Re: ruleutils with pretty-print option

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: ruleutils with pretty-print option
Date: 2003-07-27 23:44:41
Message-ID: 3F2463E9.9010400@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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 function, one that pulls the pretty print
>option, and another that doesn't, and they both call a normal C function?
>
>
Hi Bruce,

sorry for my late reply, I was out for a day.

I wasn't aware of that regression test checking the arg count of the
functions. I wanted to keep the impact on the source tree as small as
possible, so I implemented that kind of overloaded functions.

I clearly understand that Tom doesn't like to weaken the check, because
in most cases a regression failure really is a coding problem.

I recoded the stuff as Tom recommended, leaving the non-pretty version
function names as they used to be, inventing new pg_get_XXXX_ext
functions for the extended stuff, and pushing the code down into
pg_get_XXXX_worker functions when needed. We now need the additional
prototype include patch from builtins.h.

All-new stuff attached, diff'ed against the current cvs.

Regards,
Andreas

Attachment Content-Type Size
pg_proc.h.diff text/plain 1.8 KB
builtins.h.diff text/plain 1.3 KB
ruleutils.c.diff text/plain 58.7 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-07-28 00:35:07 Re: ruleutils with pretty-print option
Previous Message Bruce Momjian 2003-07-27 20:24:19 Re: ruleutils with pretty-print option