Search Postgresql Archives

pg_restore --clean failing due to dependancies

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

 



Hi all

Postgresql 9.3.14 on Windows.
Hi am making daily backups of a database and omitting two schemas from the dump (and the public schema). Those schemas are read-only and have no dependancy with the rest of the database.
My command is :
pg_dump -h pgsql1 -U postgres -b -Fc -E UTF8 -N public -N osm -N osm2 -f "D:\db.dump" db1

(I also omit "public" because we use postgis, so it's cleaner for me to dump without the public schema, then start from an empty database and do a "create extension postgis" before restoring)

I can successfully restore this dump without any error in an empty database.

Now, I would like to restore this dump in a database where the aforementioned schemas have been loaded. So i would like to do a pg_restore --clean, in order two preserve those two schemas (and the public one), and to restore everything else.
The restore fails on a lot of statements, complaining about dependencies.
For instance, "cannot drop rule _RETURN on view myview1 because view myview1requires it". Or "cannot drop constraint mypkey on table my table because other objects depend on it [list of foreign keys]".

My command is :
pg_restore -U postgres -h pgsql1 --clean -d db1 "D:\db.dump"

I thought that pg_restore was supposed to reorder the objects to honor dependencies ? How can I get this right ?

Thanks for your help !
Cheers

--
Arnaud




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



[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