Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D64B61337B77 for ; Tue, 5 Oct 2010 03:39:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 86705-06 for ; Tue, 5 Oct 2010 06:39:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id B02C71336971 for ; Tue, 5 Oct 2010 03:39:25 -0300 (ADT) Received: from [192.168.42.162] (LCaen-151-93-7-26.w80-13.abo.wanadoo.fr [80.13.230.26]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 26EB63B8F5; Tue, 5 Oct 2010 08:39:24 +0200 (CEST) Message-ID: <4CAAC81B.7030205@lelarge.info> Date: Tue, 05 Oct 2010 08:39:23 +0200 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: =?ISO-8859-1?Q?F=E1bio_Gibon_-_Comex_System?= CC: PostgreSQL - mailing list Subject: Re: Validade dump file References: <120c01cb643d$cb46ab60$aadd5bbb@gibon> In-Reply-To: <120c01cb643d$cb46ab60$aadd5bbb@gibon> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.324 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_NJABL_PROXY=2.224 X-Spam-Level: X-Archive-Number: 201010/31 X-Sequence-Number: 35772 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