The following sql file runs without error; however it does no display any output. The file is executed with: pslq -d database -f filename. How can this be modified to display output?
do $$
declare tn varchar ;
begin
for tn in
select tablename from pg_tables where tableowner not like 'postgres%'
loop
EXECUTE format('SELECT count(*) from %I;', tn);
end loop;
end;
$$;