#!/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`