pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chander Ganesan <chander@otg-nc.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6176: pg_dump dumps pg_catalog tables
Date: Thu, 25 Aug 2011 10:52:03 -0400
Message-ID: <2120.1314283923@sss.pgh.pa.us> (raw)
In-Reply-To: <201108251300.p7PD0HiL074200@wwwmaster.postgresql.org>
References: <201108251300.p7PD0HiL074200@wwwmaster.postgresql.org>

"Chander Ganesan" <chander@otg-nc.com> 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



view thread (3+ messages)  latest in thread

Message-ID: <2120.1314283923@sss.pgh.pa.us>
Permalink:  ../2120.1314283923@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2120.1314283923@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chander@otg-nc.com
  Subject: Re: BUG #6176: pg_dump dumps pg_catalog tables
  In-Reply-To: <2120.1314283923@sss.pgh.pa.us>
  References: <201108251300.p7PD0HiL074200@wwwmaster.postgresql.org> <2120.1314283923@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox