Dear Sirs I'm about to write plpgsql function which will "vacuum full" all existing databases. Below is an example how to get list of databases.
What should I write instead of "raise notice" ? CREATE OR REPLACE FUNCTION vacuum_all() RETURNS integer AS ' DECLARE query text; list RECORD; BEGIN FOR list IN SELECT datname FROM pg_catalog.pg_database WHERE NOT datistemplate LOOP raise notice ''datname = %'',list.datname; END LOOP; RETURN 0; END; ' LANGUAGE plpgsql; ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend