From: Kris Kiger <kris@musicrebellion.com>
To: pgsql-admin@postgresql.org
Subject: Sending a libpq C function variables through function call
Date: Tue, 02 Dec 2003 16:54:21 -0500
Message-ID: <3FCD0A0D.1050502@musicrebellion.com> (raw)
References: <20031202195830.54576.qmail@web21407.mail.yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: kris@musicrebellion.com
Subject: Re: Sending a libpq C function variables through function call
In-Reply-To: <3FCD0A0D.1050502@musicrebellion.com>
References: <20031202195830.54576.qmail@web21407.mail.yahoo.com> <3FCD0A0D.1050502@musicrebellion.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox