I have this code iin my plpgsql function
DECLARE
foo text;
begin
foo:='bar';
execute ....
and now I want to select currval() from the sequence whose name is
stored in the foo variable, with the execute command.
can I do
execute 'select currval( \'' || foo || '\')';
?