All-wrong-and-ugly solution to using exact match variables which are
[webpac] / tools / count_tables.sh
index 392c37d..29f7168 100755 (executable)
@@ -9,4 +9,4 @@ else
 fi
 
 echo "records in $db, by table"
-psql $db -A -t -F : -c "\d" | cut -d: -f2 | xargs -i psql $db -A -t -F "       " -c "select count(*),'{}' from {}" | sort -nr
+psql $db -A -t -c "select tablename from pg_tables where tablename not like 'pg_%'" | xargs -i psql $db -A -t -F "     " -c "select count(*),'{}' from {}" | sort -nr