Function C and INOUT parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • diegoM
    New Member
    • Mar 2009
    • 2

    Function C and INOUT parameters

    Hello,

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

    Code:
    CREATE OR REPLACE FUNCTION add_one(INOUT arg1 integer, INOUT arg2 integer)
    [B]RETURNS record[/B]
    AS '$libdir/myDLL.dll', 'add_one'
    LANGUAGE 'c' VOLATILE STRICT ;
    In the DLL, I have a function C (it's just a test function) :

    Code:
    void add_one(int arg1, int arg2)
    {
    arg1 = arg1 + 1 ;
    arg2 = arg2 + 1 ;
    }
    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.
    Last edited by eWish; Mar 22 '09, 04:41 PM. Reason: Please use code tags
Working...