How does quotes work with dynamic queries?

Поиск
Список
Период
Сортировка
От A B
Тема How does quotes work with dynamic queries?
Дата
Msg-id dbbf25900805300230v4a4a75dele01686f8078cd8b6@mail.gmail.com
обсуждение исходный текст
Список pgsql-novice
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 || '\')';
?

В списке pgsql-novice по дате отправления: