Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id CFEE6B5DC51 for ; Thu, 25 Aug 2011 11:52:15 -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 76782-01 for ; Thu, 25 Aug 2011 14:52:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id BC323B5DC09 for ; Thu, 25 Aug 2011 11:52:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p7PEq358002121; Thu, 25 Aug 2011 10:52:04 -0400 (EDT) To: "Chander Ganesan" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6176: pg_dump dumps pg_catalog tables In-reply-to: <201108251300.p7PD0HiL074200@wwwmaster.postgresql.org> References: <201108251300.p7PD0HiL074200@wwwmaster.postgresql.org> Comments: In-reply-to "Chander Ganesan" message dated "Thu, 25 Aug 2011 13:00:17 +0000" Date: Thu, 25 Aug 2011 10:52:03 -0400 Message-ID: <2120.1314283923@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.432 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.532 X-Spam-Level: X-Archive-Number: 201108/147 X-Sequence-Number: 30959 "Chander Ganesan" writes: > Normally, the pg_dump command ignored the pg_catalog tables when performing > a dump. However, when provided the '--table' argument it fails to ignore > the pg_catalog table. > For example, suppose I had tables p1-p10 that I wanted to dump, I could use > the following command: > pg_dump test_db --table 'p*' > This command would dump the requested tables, but it would also dump all the > tables (in all schemas) that start with 'p*' . Generally speaking, there > are no "excluded schemas" when using the pg_dump command with the '--table' > argument. > It is my belief that the pg_catalog tables should almost always be ignored > (lest restores fail miserably). This proposal seems overly simplistic to me: if we did this, it would be impossible to use pg_dump to dump a catalog's contents at all. (I don't care whether the resulting script is restorable; sometimes you just need to see what's actually in pg_class.) I wonder whether it would be helpful to provide a default setting for --exclude-schema that lists pg_catalog, information_schema, etc. If we approached it that way, it'd be possible to override the default at need. However, I'm not sure how that switch interacts with wildcard --table specs ... regards, tom lane