here is my function
The place where its giving an error is
select return_shit(temp); which is where i'm trying to call the function.
Thanks in advance
create function return_shit (int4) returns int4 as '
idvar alias for $1;
select parent into test from categories where id=idvar;
if test > 0 then
' language 'plpgsql';