Re: pg_dump excluding tables content but not table schema - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: pg_dump excluding tables content but not table schema
Date
Msg-id 20091231113755.735c1f66@dawn.webthatworks.it
Whole thread Raw
In response to Re: pg_dump excluding tables content but not table schema  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: pg_dump excluding tables content but not table schema
List pgsql-general
On Mon, 28 Dec 2009 21:20:17 +0100
Ivan Sergio Borgonovo <mail@webthatworks.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


pgsql-general by date:

Previous
From: Tony Caduto
Date:
Subject: Re: Visual DATA editor for PostgreSQL?
Next
From: Dmitry Koterov
Date:
Subject: Re: Visual DATA editor for PostgreSQL?