projects
/
webpac
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
added template example (which include do_checkbox JavaScript)
[webpac]
/
tools
/
count_tables.sh
1
#!/bin/sh
2
3
# count number of records in all tables
4
5
if [ -z "$1" ] ; then
6
db="webpac-dev"
7
else
8
db=$1
9
fi
10
11
echo "records in $db, by table"
12
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