views:

23

answers:

1

I got some SQL function

CREATE OR REPLACE FUNCTION tools.update_company(IN company_id integer, OUT value integer)
     RETURNS integer AS
 $BODY$

BEGIN 
select * into value from function_making_int(company_id)
END;$BODY$

and from Psycopg2 (its inside Django if that matters) I do

c = connection.cursor()
c.callproc('tools.update_company', [1, ])

but function returns exactly the same input sequence as I gave, ignoring results and OUT parameter. Change to IN OUT and passing some foo value changes nothing. When called within database SQL function works as expected

A: 

Well I did little research and I've checked psycopg2 code - current implementation of this function just do

select * from function_name(params)
return params

so it does not modify anything in any way.

M4ks