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

Contents of /trunk/tools/count_tables.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 116 - (show 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 #!/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 -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