From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Marc Lavergne <mlavergne-pub(at)richlava(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Oracle Decode Function |
Date: | 2002-07-26 15:43:37 |
Message-ID: | 25849.1027698217@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Marc Lavergne <mlavergne-pub(at)richlava(dot)com> writes:
>>> contrib/fulltextindex/fti.c uses variable numbers of arguments...
> I see the code, but maybe I don't SEE the code. I'm only on my second
> cup of coffee so I may be missing something but I am not betting any
> money in it :) Fulltextindex appears to work because it's called within
> a trigger but I don't think you can get the parser not to complain about
> arguments when your function is not called internally by the trigger
> manager.
Right, fti.c is using a variable number of *trigger* arguments, which
is a whole different can of worms.
What you can do, if you are so inclined, is to rely on function
overloading to make several pg_proc entries of the same name and
different numbers of arguments that all point at the same underlying
C function. Then the C function would have to check how many
arguments it was actually passed. Slightly ugly, but doable.
There is some stuff in fmgr.h that anticipates a future feature of
real varargs function declarations ... but we don't support it yet.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-07-26 15:48:01 | Re: Password sub-process ... |
Previous Message | Rod Taylor | 2002-07-26 15:30:06 | Re: Password sub-process ... |