From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Fábio Gibon - Comex System <gibon(at)comexsystem(dot)com(dot)br> |
Cc: | PostgreSQL - mailing list <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Validade dump file |
Date: | 2010-10-05 06:39:23 |
Message-ID: | 4CAAC81B.7030205@lelarge.info |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Le 05/10/2010 05:28, Fábio Gibon - Comex System a écrit :
> [...]
> are there some tool or internal program that read a dump file (created by pg_dump) and list all tables and number of tuples (without
> restore) in this file?
>
That command should give you the number of tables in your plain dump:
grep "CREATE TABLE" your_dump_file | wc -l
If you have a binary dump (ie, tar or custom), you should do this:
pg_restore -s your_dump_file | grep "CREATE TABLE" | wc -l
There's no easy way to get the number of tuples in each table.
> And too, are there some tool to check the physical file integrity? (S.O. Windows)
notepad? :)
I mean, with a SQL file, this is just a bunch of SQL queries. So there's
no real way to check the file integrity without restoring it.
On a binary dump, you can do a "pg_restore your_dump_file > /dev/null".
It should warn you if you have an integrity issue.
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Johann Spies | 2010-10-05 07:34:56 | Indexing error |
Previous Message | Vishnu S. | 2010-10-05 05:33:08 | Re: [GENERAL] Data Not replicating |