How does quotes work with dynamic queries? - Mailing list pgsql-novice

From A B
Subject How does quotes work with dynamic queries?
Date
Msg-id dbbf25900805300230v4a4a75dele01686f8078cd8b6@mail.gmail.com
Whole thread Raw
List 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 by date:

Previous
From: "Mike Ellsworth"
Date:
Subject: Re: Dreamweaver 8 and PostgreSQL 'integration' with PHP???
Next
From: "A B"
Date:
Subject: need help with drop table command