Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-17 Thread Arnaud L.
Le 16/11/2016 à 20:05, Tom Lane a écrit : Arnaud Lesauvage writes: [ dump from problematic database ] OK, thanks for the test case. The problem here is that pg_dump is setting up a circular dependency that it doesn't know how to break correctly. You've got a

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-16 Thread Tom Lane
Arnaud Lesauvage writes: > [ dump from problematic database ] OK, thanks for the test case. The problem here is that pg_dump is setting up a circular dependency that it doesn't know how to break correctly. You've got a couple of views that are implicitly dependent on

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Adrian Klaver
On 11/15/2016 08:09 AM, Arnaud L. wrote: Le 15/11/2016 à 16:44, Tom Lane a écrit : You'd have to provide a lot more detail before anyone could tell if there was a fixable bug here, but I rather doubt it. There are at least two ways this scenario might lose: 1. There are additional objects in

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Adrian Klaver
On 11/15/2016 07:55 AM, Arnaud L. wrote: Le 15/11/2016 à 16:21, Adrian Klaver a écrit : 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

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Tom Lane
"Arnaud L." writes: > The target databased was restored from the dump in an empty database. > So what I do is : > dropdb -U postgres -h localhost db1 > createdb -U postgres -h localhost db1 > psql -U postgres -h localhost -c "CREATE EXTENSION postgis" db1 > pg_dump -h

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Arnaud L.
Le 15/11/2016 à 16:44, Tom Lane a écrit : You'd have to provide a lot more detail before anyone could tell if there was a fixable bug here, but I rather doubt it. There are at least two ways this scenario might lose: 1. There are additional objects in the target database that have dependencies

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Arnaud L.
Le 15/11/2016 à 16:21, Adrian Klaver a écrit : 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

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Tom Lane
"Arnaud L." writes: > 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

Re: [GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Adrian Klaver
On 11/15/2016 07:11 AM, Arnaud L. wrote: 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

[GENERAL] pg_restore --clean failing due to dependancies

2016-11-15 Thread Arnaud L.
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