What's the correct way to use FunctionCallInvoke()?

From: Zoltan Boszormenyi <zb(at)cybertec(dot)at>
To: pgsql-general(at)postgresql(dot)org
Subject: What's the correct way to use FunctionCallInvoke()?
Date: 2007-06-08 05:08:13
Message-ID: 4668E43D.8010406@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a problem calling a C function
from another C function - DirectFunctionCall*
cannot be used since some parameters may be NULL.
This dies:

FunctionCallInfoData fcinfo1;

InitFunctionCallInfoData(fcinfo1, NULL, 7, NULL, NULL);
/* arg[] and arnull[] are filled with correct values */
result = myfunc(&fcinfo1);

Also this also:

FunctionCallInfoData fcinfo1;
FmgrInfo flinfo1;

MemSet(&flinfo1, 0, sizeof(flinfo1));
flinfo1.fn_addr = myfunc;
flinfo1.fn_nargs = 7;
InitFunctionCallInfoData(fcinfo1, &flinfo1, 7, NULL, NULL);
/* arg[] and arnull[] are filled with correct values */
result = FunctionCallInvoke(&fcinfo1);

How to do it correctly? I am on PostgreSQL 8.1.9 currently.

--
----------------------------------
Zoltán Böszörményi
Cybertec Geschwinde & Schönig GmbH
http://www.postgresql.at/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2007-06-08 05:14:14 Re: Creditcard Number Security was Re: Encrypted column
Previous Message John Meyer 2007-06-08 04:45:00 Re: [SQL] subtract a day from the NOW function