Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: pg_dump excluding tables content but not table schema


  • From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Re: pg_dump excluding tables content but not table schema
  • Date: Thu, 31 Dec 2009 11:37:55 +0100
  • Message-id: <20091231113755.735c1f66@dawn.webthatworks.it> <text/plain>

On Mon, 28 Dec 2009 21:20:17 +0100
Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> wrote:

> pg_dump -Fc -Z9 -s -t *.cache* -d mydb > schema_only.bak
> pg_dump -Fc -Z9 -T *.cache* -d mydb > nearly_full.bak

> cat nearly_full.bak schema_only.bak | pg_restore -1 -d mydb

> It seems it is working... I'll test if everything is there.

Unfortunately it doesn't work as expected.
It silently skip to restore the second backup (schema_only.bak).
I'm surprised it didn't output any error message, but the cache
tables aren't there.

It seems that you have to actually restore the 2 backup separately.

pg_restore -1 -d mydb < nearly_full.bak
pg_restore -1 -d mydb < schema_only.bak

I can't think of any other way to restore both in one transaction
unless I backup in plain text. But that should have other drawback.

Any hint?

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group