On Tue, Mar 24, 2009 at 4:54 PM, Ben Ali Rachid <souliman...@yahoo.fr> wrote: > Hello, > > I posted my problem (on pgsql-interfaces list) about the INOUT parameters on > PostgreSQL 8.3.6 (Win32), but without success. I re-post my question here, > while hoping to have more success.
Personally I'm of the opinion we should eliminate most of these duplicative mailing lists like -performance and -interfaces and just use -general. I don't see that having multiple lists for user questions helps either the users or the answerers due to just this type of problem. > When I use a function with one INOUT (or OUT) parameter like below, > everyting is OK. > > CREATE OR REPLACE FUNCTION add_one(INOUT arg integer) > RETURNS integerĀ AS '$libdir/myDLL.dll', 'add_one' > LANGUAGE 'c' VOLATILE STRICT ; > > // In 'myDLL' > void add_one(int arg) a) you should probably be using V1 calling api rather than V0. see http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html#AEN40901 b) you need to arrange for the C function to return a record with all the returned fields. You can't just set the parameters to new values and return void. The api to return a record is at: http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html#AEN41361 -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers