/[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 117 - (hide annotations)
Mon Jul 21 16:05:42 2003 UTC (20 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 301 byte(s)
use select query and not \d

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 dpavlin 117 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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26