Re: PL/C functions - Mailing list pgsql-general

From Tom Lane
Subject Re: PL/C functions
Date
Msg-id 16240.1060720302@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/C functions  (Dennis Gearon <gearond@cvc.net>)
Responses Re: PL/C functions  (Joe Conway <mail@joeconway.com>)
List pgsql-general
Dennis Gearon <gearond@cvc.net> writes:
>> We have no animal called "PL/C".  Kindly be more clear about what your
>> question is.

> User defined functions written in C/C++?

Okay.  The answer is:

1. There is no provision for a single pg_proc entry to have a variable
number of arguments.

2. You can make multiple pg_proc entries referencing the same C
function.  The C function can find out how many arguments it was
actually passed (use PG_NARGS()).

So you could make several different pg_proc entries and get the desired
effect, at some tedium.

Joe Conway has posted a few examples using this approach, IIRC.

            regards, tom lane

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: PL/C functions
Next
From: David Siebert
Date:
Subject: Simple DBI question