Re: Validade dump file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux