From gibon@comexsystem.com.br Tue Oct 5 03:40:27 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8F0E41337BB2 for ; Tue, 5 Oct 2010 00:40:27 -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 36501-09 for ; Tue, 5 Oct 2010 03:40:20 +0000 (UTC) X-Greylist: delayed 00:08:49.224571 by SQLgrey-1.7.6 Received: from ns3b.twi.com.br (ns3b.twi.com.br [201.87.225.54]) by mail.postgresql.org (Postfix) with ESMTP id D31161337BAC for ; Tue, 5 Oct 2010 00:40:19 -0300 (ADT) Received: (qmail 78140 invoked from network); 5 Oct 2010 00:29:51 -0300 Received: from unknown (HELO gibon) (gibon@comexsystem.com.br@[187.91.219.44]) (envelope-sender ) by ns3b.twi.com.br (qmail-ldap-1.03) with SMTP for ; 5 Oct 2010 00:29:50 -0300 Message-ID: <120c01cb643d$cb46ab60$aadd5bbb@gibon> Reply-To: =?Windows-1252?Q?F=E1bio_Gibon_-_Comex_System?= From: =?Windows-1252?Q?F=E1bio_Gibon_-_Comex_System?= To: "PostgreSQL - mailing list" Subject: Validade dump file Date: Tue, 5 Oct 2010 00:28:57 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_1209_01CB6424.4CB1EBC0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.801 tagged_above=-10 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201010/29 X-Sequence-Number: 35770 This is a multi-part message in MIME format. ------=_NextPart_000_1209_01CB6424.4CB1EBC0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi everybody, 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=20 restore) in this file? And too, are there some tool to check the physical file = integrity? (S.O. Windows) thanks=20 F=E1bio Henrique Gibon ------=_NextPart_000_1209_01CB6424.4CB1EBC0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi everybody,
        are = there some=20 tool or internal program that read a dump file (created by pg_dump) and = list all=20 tables and number of tuples (without
restore) in this file?
 
        And too, are there some = tool to=20 check the physical file integrity? (S.O. Windows)
 
thanks
F=E1bio Henrique Gibon
 
------=_NextPart_000_1209_01CB6424.4CB1EBC0-- From guillaume@lelarge.info Tue Oct 5 06:39:32 2010 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 From willybas@gmail.com Tue Oct 5 14:39:57 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 932DD1337BC1 for ; Tue, 5 Oct 2010 11:39:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 60763-06-3 for ; Tue, 5 Oct 2010 14:39:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com [209.85.216.46]) by mail.postgresql.org (Postfix) with ESMTP id 2E08A1337BDF for ; Tue, 5 Oct 2010 11:39:50 -0300 (ADT) Received: by qwh6 with SMTP id 6so80000qwh.19 for ; Tue, 05 Oct 2010 07:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=miGM64Tuz8u0uvy3QbzkN5LjZAuHVpSGHezRuxi4wS4=; b=hHDnW4hO8mV8uPx98VFUYSezvu+pJ8bMa+8sRJxAD2Wed3Za8JQ6sUqlYYofk2vsAk lkSWokGOg1DB6eDAZi6P/TWFuKQMFM6zN7jAkHfuVSg64AoZbWAN/cdoPIKuL9kBML7M v2Ijlv4JSTQWbw/yApzEbI2jiAL8UC7aFTUvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=NWo9IxL65qSt03oFvZ4CV3D/4RWdvNEmbxg+l+PNY09I57b53OTEXke0YRUOaeBBBk lO+jCOt0VgpcpO1SmBKigX9D/JSbfl54HGTbSKN8KfTZBLwd5RdU5RGSPDTS0BebnYrn ksyPNCTTbDzec1NUKOOsezMZedIO/PBFmA+Z8= MIME-Version: 1.0 Received: by 10.229.64.75 with SMTP id d11mr8439465qci.20.1286289590736; Tue, 05 Oct 2010 07:39:50 -0700 (PDT) Received: by 10.229.39.82 with HTTP; Tue, 5 Oct 2010 07:39:50 -0700 (PDT) In-Reply-To: <4CAAC81B.7030205@lelarge.info> References: <120c01cb643d$cb46ab60$aadd5bbb@gibon> <4CAAC81B.7030205@lelarge.info> Date: Tue, 5 Oct 2010 16:39:50 +0200 Message-ID: Subject: Re: Validade dump file From: Willy-Bas Loos To: Guillaume Lelarge Cc: =?ISO-8859-1?Q?F=E1bio_Gibon_=2D_Comex_System?= , PostgreSQL - mailing list Content-Type: multipart/alternative; boundary=0016e65da9102259c20491dfa243 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.499 tagged_above=-10 required=5 tests=BAYES_05=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/36 X-Sequence-Number: 35777 --0016e65da9102259c20491dfa243 Content-Type: text/plain; charset=ISO-8859-1 cool actually. any idea for the number of tuples? count all lines after COPY .* ) FROM stdin; until \. (but how?) on a side note: what's the difference between the admin list and the general list? -- "Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw --0016e65da9102259c20491dfa243 Content-Type: text/html; charset=ISO-8859-1 cool actually.
any idea for the number of tuples?
count all lines after COPY .* ) FROM stdin;
until \.
(but how?)

on a side note: what's the difference between the admin list and the general list?


--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw
--0016e65da9102259c20491dfa243-- From Kevin.Grittner@wicourts.gov Tue Oct 5 15:35:33 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 19ED51337B92 for ; Tue, 5 Oct 2010 12:35:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 99364-02 for ; Tue, 5 Oct 2010 15:35:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 2DAC31337B8D for ; Tue, 5 Oct 2010 12:35:24 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 05 Oct 2010 10:35:23 -0500 Message-Id: <4CAAFF660200002500036525@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 05 Oct 2010 10:35:18 -0500 From: "Kevin Grittner" To: "Willy-Bas Loos" , "Guillaume Lelarge" Cc: , "PostgreSQL - mailing list" Subject: Re: Validade dump file References: <120c01cb643d$cb46ab60$aadd5bbb@gibon> <4CAAC81B.7030205@lelarge.info> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/39 X-Sequence-Number: 35780 Willy-Bas Loos wrote: > any idea for the number of tuples? Your best bet would be to use whatever scripting language you like which has decent support for regular expressions. Expect to tweak your expressions a bit as you discover the corner cases where you're not getting the count you expect. > on a side note: what's the difference between the admin list and > the general list? This thread is OK on admin -- which is targeted toward operational issues. If in doubt, general can include just about anything. It gets traffic about equal to all the more specific lists combined, so it's a bit much for some of us to follow. Some people (like me) who can't absorb the volume of traffic on general follow a few more specialized lists where we feel we're best able to help. If discussion on one list dies out without a satisfactory resolution, it's OK to try another likely-looking list -- particularly if there's no further repsonse on the initial list for a few days. While there's a fair amount of overlap, you will get a somewhat different set of people tracking each list. -Kevin