Re: [GENERAL] Re: Restoring tables with circular references dumped toseparate files - Mailing list pgsql-general

From Melvin Davidson
Subject Re: [GENERAL] Re: Restoring tables with circular references dumped toseparate files
Date
Msg-id CANu8FiznwXTCL8BKyMg-cKioFenthiF040ceX=z=h3w-ca8iOA@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Re: Restoring tables with circular references dumped to separatefiles  (doganmeh <mehmet@edgle.com>)
Responses [GENERAL] Re: Restoring tables with circular references dumped to separatefiles  (doganmeh <mehmet@edgle.com>)
List pgsql-general


On Sat, Oct 21, 2017 at 8:24 AM, doganmeh <mehmet@edgle.com> wrote:
Seems that would be easier and less error prone. Thanks,



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


>I was dumping each table to a separate file so I could pick and choose when restoring...

It seems to me that instead on multiple single table dumps, you could take advantage of restoring from a list-file.

Just
1. do a dump with custom format ( -F c)
EG: pg_dump -U postgres -F c -t table1 -t table2 -t table3 yourdb > yourdb.dmp

2. use pg_restore -l to create a list-file
EG: pg_restore -l yourdb.dmp > yourdb.lis

3. edit yourdb.lis and comment out ( prefix with ; ) any line you don't want

4. then use pg_restore with the edited list-file 
EG:  pg_restore -L yourdb.lis yourdb.dmp

See examples at the end of

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

pgsql-general by date:

Previous
From: doganmeh
Date:
Subject: [GENERAL] Re: Restoring tables with circular references dumped to separatefiles
Next
From: israel
Date:
Subject: Re: [GENERAL] Weird performance difference