/[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

Annotation of /trunk/tools/count_tables.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 116 - (hide annotations)
Mon Jul 21 15:54:57 2003 UTC (20 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 259 byte(s)
you can specify database name

1 dpavlin 89 #!/bin/sh
2    
3     # count number of records in all tables
4    
5 dpavlin 116 if [ -z "$1" ] ; then
6     db="webpac-dev"
7     else
8     db=$1
9     fi
10 dpavlin 89
11     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

Properties

Name Value
cvs2svn:cvs-rev 1.2
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26