pgsql.init/pgdump.sh
authorAlan Knowles <alan@roojs.com>
Mon, 11 Nov 2013 14:59:43 +0000 (22:59 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 11 Nov 2013 14:59:43 +0000 (22:59 +0800)
pgsql.init/pgdump.sh

index 9fcdd27..03c42c5 100644 (file)
@@ -1,15 +1,15 @@
 #!/bin/bash
 
  
-for table in  `psql -Uadmin testxtuple -Atc  "SELECT nspname || '.' || c.relname FROM pg_class c LEFT JOIN pg_namespace N ON (N.oid =c.relnamespace) WHERE c.relkind = 'S';" | cut -d '|' -f1`
-do   
-   pg_dump -Uadmin  --disable-triggers testxtuple -Fp -t $table -a -f /tmp/pgdump/$table.sql;
-   one=`grep  SELECT /tmp/pgdump/$table.sql  | grep -v 1`
-   if [ "$one" != "" ]
-        then
-        rm /tmp/pgdump/$table.sql;
-   fi
-done
+#for table in  `psql -Uadmin testxtuple -Atc  "SELECT nspname || '.' || c.relname FROM pg_class c LEFT JOIN pg_namespace N ON (N.oid =c.relnamespace) WHERE c.relkind = 'S';" | cut -d '|' -f1`
+#do   
+#   pg_dump -Uadmin  --disable-triggers testxtuple -Fp -t $table -a -f /tmp/pgdump/$table.sql;
+#   one=`grep  SELECT /tmp/pgdump/$table.sql  | grep -v 1`
+#   if [ "$one" != "" ]
+#        then
+#        rm /tmp/pgdump/$table.sql;
+#   fi
+#done
 
 
 for table in `psql -Uadmin testxtuple -Atc "SELECT   nspname || '.' || relname,reltuples FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid =C.relnamespace) WHERE    nspname NOT IN ('pg_catalog', 'information_schema') AND  relkind='r' and reltuples != 0 ORDER BY reltuples DESC;" | cut -d '|' -f1`