Sending a libpq C function variables through function call

From: Kris Kiger <kris(at)musicrebellion(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Sending a libpq C function variables through function call
Date: 2003-12-02 21:54:21
Message-ID: 3FCD0A0D.1050502@musicrebellion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

I've got a function in PG set up, the libpq C call goes like this:

PERFORM funcName(''t1'', ''t2'', ''t3'', ''t4'', NEW.someInteger,
NEW.someBoolean)

funcName looks like this:

create function funcName(text, text, text, text, int, boolean)
returns int as '/var/lib/postgres/CfileName.so', 'CfunctionName'
language 'C';

the C function header accepts each of these arguments as
CfunctionName(char* name1, char* name2, char* name3, char* name4, int
variable1, bool variable2). When I try to grab a value, say from name1,
I get nothing. So, for some reason parameters are not being passed.
I'm not sure if there is a good way to pass parameters through libpq,
or will I have to use something like SPI to grab them? Use of libpq is
preferable, but not absolute. I appreciate the input!

Kris

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alvar Freude 2003-12-02 23:07:12 Cast text to bytea
Previous Message ow 2003-12-02 19:58:30 pg_dump and schemas