create or replace function foo(integer) returns text as ' declare theint alias for $1; begin return theint::text; end;' language 'plpgsql';