The correct answer is a comment by Anton Kovalenko
You cannot use a variable as the name of a table or column in embedded SQL.
UPDATE dynamic_table_name SET ....
PostgreSQL SQL, () - - , . , PostgreSQL ( - ).
SQL - . SQL
DO $$
DECLARE r record;
BEGIN
FOR r IN SELECT table_name
FROM information_schema.tables
WHERE table_catalog = 'public'
LOOP
EXECUTE format('UPDATE %I SET id = 10 WHERE id = 15', r.table_name);
END LOOP;
END $$;
: SQL ( SQL-) . "format". quote_ident.
EXECUTE 'UPDATE ' || quote_ident(r.table_name) || 'SET ...