do this via execute in a stored procedure - something like this (written on the
flow - untested!)
returns setof text
declare
my_record record;
my counter as bigint;
begin
for my_record in
select tablename from pg_tables where
schemaname = 'public'
loop
execute into counter
What's the best way to count how many rows are in each table via SQL? Or
is it even possible?
I'm trying something like:
select tablename, count(*) from (select tablename from pg_tables where
schemaname = 'public') as test group by tablename;
But obviously this just gives a count of 1 for ea