Search Postgresql Archives

Re: Re: Restoring tables with circular references dumped to separate files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Sat, Oct 21, 2017 at 8:24 AM, doganmeh <mehmet@xxxxxxxxx> 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@xxxxxxxxxxxxxx)
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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux