--Get list of all public tables SELECT DISTINCT tablename FROM pg_table_def WHERE schemaname ='public';