Re: pg_dump -s dumps data?!

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump -s dumps data?!
Date: 2012-01-30 13:08:41
Message-ID: 20120130130841.GB7291@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sat, Jan 28, 2012 at 01:10:39PM -0500, Tom Lane wrote:
> hubert depesz lubaczewski <depesz(at)depesz(dot)com> writes:
> > is it by design that tables listed there (in extconfig column of
> > pg_extension) will be dumped with data, even for pg_dump --schema?
>
> Um, yes. Read the manual.
> http://www.postgresql.org/docs/9.1/static/extend-extensions.html#AEN51966

Yes, but:

If you create table using extensions, and the you insert data to it
- this data will *not* be dumped using pg_dump.
If you mark the table with pg_extension_config_dump() - the data fro the
table will be dumped *always* - even for -s dump of another table.
I.e. pg_dump -s -t a will dump data of table b!

So long story short - with currently released versions it is either:
- you will never get data for given table in dumps
or
- you will get data for this table in dump, always, even for schema-only
dumps of unrelated tables.

Now.

I have since made some tests, and it looks like the dumping thing is
fixed in 9.2devel from git HEAD, which seems to suggest that it will
work sanely in 9.1.3 - so the point is kind of moot.

But the fact that is the newest released Pg provides mechanism that
completely breaks pg_dump functionality.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James Robinson 2012-01-30 14:32:33 Re: 9.0.6 "cluster" transient failure ...
Previous Message Simon Riggs 2012-01-30 09:25:53 Re: Hot standby off of hot standby?

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2012-01-30 14:54:13 Re: JSON for PG 9.2
Previous Message horiguchi.kyotaro 2012-01-30 11:42:20 Re: Speed dblink using alternate libpq tuple storage