--- trunk/tools/count_tables.sh 2003/07/13 12:24:06 89 +++ trunk/tools/count_tables.sh 2003/07/21 16:05:42 117 @@ -2,7 +2,11 @@ # count number of records in all tables -db="webpac-dev" +if [ -z "$1" ] ; then + db="webpac-dev" +else + db=$1 +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