I'm fairly new to Postgres, and I'm wondering if there is a way to run strings as queries (not in PL/pgSQL, I get that that's not something you can do in the psql prompt). Specifically, in questions such as this one, you generate a batch script using a query, like this:
select 'drop table if exists "' || tablename || '" cascade;' from pg_tables;
But how do you run it?