/[webpac]/trunk/tools/count_tables.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/tools/count_tables.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 89 by dpavlin, Sun Jul 13 12:24:06 2003 UTC revision 116 by dpavlin, Mon Jul 21 15:54:57 2003 UTC
# Line 2  Line 2 
2    
3  # count number of records in all tables  # count number of records in all tables
4    
5  db="webpac-dev"  if [ -z "$1" ] ; then
6            db="webpac-dev"
7    else
8            db=$1
9    fi
10    
11  echo "records in $db, by table"  echo "records in $db, by table"
12  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 -F : -c "\d" | cut -d: -f2 | xargs -i psql $db -A -t -F "        " -c "select count(*),'{}' from {}" | sort -nr

Legend:
Removed from v.89  
changed lines
  Added in v.116

  ViewVC Help
Powered by ViewVC 1.1.26