Specifically, if you are looking for a procedure to perform any spontaneous action with these tables, I usually build a script at the moment with a very easy structure and it is not necessary to create a function, execute it and then delete it.
Using the query of Juan Pinzón, the script would be as follows:
DO
$$
DECLARE
_schema text;
_table text;
BEGIN
FOR _schema, _table IN
SELECT table_schema, table_name
FROM information_schema.tables
-- No filtro por esquema 'public' porque yo uso muchos más esquemas
WHERE table_type = 'BASE TABLE'
LOOP
-- En este bloque LOOP puedes introducir tu código para hacer lo que quieras
-- con las tablas
-- Usando las variables _schema, _table
RAISE NOTICE 'Código a ejecutar con %, %', _schema, _table;
END LOOP;
END
$$
;