Is there a way to declare a variable in a plpgsql function, which data type is set on a parameter?
For example:
create or replace function test(datatype text)<br> returns void as $$
declare
data datatype; -- data type is stored in the text string, for example int
begin
raise notice '%', (select pg_typeof(data));
end;
$$ language plpgsql;
In other words, i am trying to write a function, and inside that function i need a variable, and that variable data type must be defined in another input parameter. Any ideas? Bests regards