By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Function C and INOUT parameters

P: 2
Hello,

I have created a function in Postgres. His code is :

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE FUNCTION add_one(INOUT arg1 integer, INOUT arg2 integer)
  2. RETURNS record
  3. AS '$libdir/myDLL.dll', 'add_one'
  4. LANGUAGE 'c' VOLATILE STRICT ;
In the DLL, I have a function C (it's just a test function) :

Expand|Select|Wrap|Line Numbers
  1. void add_one(int arg1, int arg2)
  2. {
  3. arg1 = arg1 + 1 ;
  4. arg2 = arg2 + 1 ;
  5. }
When I try to execute my function (select * from add_one(5, 10)), the server crashes (I must restart it). The problem is that if I use a function with one INOUT parameter, everything is OK. I think the problem is related to "RETURNS record", but I have no idea to solve it.

Any idea ?
Thanks

PS : For information, I work with PostgreSQL 8.3.6 and Visual Studio 2008 Professional Edition.
Mar 17 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.