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

From Raymond O'Donnell
Subject Re: pg_dump excluding tables content but not table schema
Date
Msg-id 4B3914B4.5010302@iol.ie
Whole thread Raw
In response to Re: pg_dump excluding tables content but not table schema  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses pg_dump ERROR, usename "postgres" duplicated  (Gastón Quiroga <gastonq@allytech.com>)
List pgsql-general
On 28/12/2009 20:20, Ivan Sergio Borgonovo wrote:
> On Mon, 28 Dec 2009 19:39:36 +0000
> Raymond O'Donnell <rod@iol.ie> wrote:
>
>> On 28/12/2009 18:41, Ivan Sergio Borgonovo wrote:
>>
>>> I'd like to just dump the table schema without dumping the table
>>> contend.
>
>> pg_dump -s -t <table name> <db name>
>
> My fault. I was not clear enough.
> I'd like to make a "mostly" full backup, excluding from backup just
> the data of some tables but backing up the schema of those tables.
>
> mmm let me try if
>
> 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.

I don't think you can do it in one step with a single invocation of
pg_dump - I reckon what you've come up with there is the way to go.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: pg_dump excluding tables content but not table schema
Next
From: Gastón Quiroga
Date:
Subject: pg_dump ERROR, usename "postgres" duplicated