Page 1 of 1

PgSqlDump

Posted: Thu 21 Jan 2016 14:53
by damon.cognito
We are using PgSqlDump to back up a schema (without indices or constraints) but it is erroring on restore on some but not databases (that have the same schema).

Code: Select all

                    using (var schemaBackup = new PgSqlDump()
                    {
                        Connection = DBAccess.GetConnection(),
                        QuoteIdentifier = true,
                        Mode = DumpMode.Schema,
                        GenerateHeader = false,
                        UseMultirowSyntax = true,
                        ObjectTypes = PgSqlDumpObjects.Schemas | PgSqlDumpObjects.Sequences | PgSqlDumpObjects.Tables | PgSqlDumpObjects.Views
                    })
                    {
                        string name = Path.Combine(GetWorkingFolder(), "dump_schema.backup");
                        schemaBackup.Backup(name);
                        ...
                    }
One of the views (wipTot) references another view (wip), but looking at the script produced by PgSqlDump, the view wip is generated it is created after wipTot (I've run the script in pgadmin and it does the same).

I am guessing that you use pg_views to retrieve the views to dump? If that is the case, that would explain the problem as that view is unordered and so there is no guarantee of which order they will be displayed. The views need to be dumped in the order they were created to solve the dependency problem.

Devart.Data.PostgreSql.Entity, Version=7.3.457.6
VS 2013
Postgresql 9.3.9

cheers!

Re: PgSqlDump

Posted: Mon 25 Jan 2016 14:09
by Pinturiccio
We could not reproduce the issue neither with version 7.3.457 nor with the latest one. Please send us the script of the database, for which you perform backup, in order to reproduce the issue.

Re: PgSqlDump

Posted: Mon 25 Jan 2016 16:02
by damon.cognito
Pinturiccio wrote:We could not reproduce the issue neither with version 7.3.457 nor with the latest one. Please send us the script of the database, for which you perform backup, in order to reproduce the issue.
I'm not allowed to send you the database, but given it only happens in a small amount of cases it is not assured to happen anyway. Can you confirm the order you get the Views back in to be able to dump them please? It might shed some light on this...

cheers!

Re: PgSqlDump

Posted: Tue 26 Jan 2016 10:57
by Pinturiccio
We have performed more tests and reproduced the issue. Now we can reproduce it reliably. We will investigate the issue and post here about the results as soon as possible.

Re: PgSqlDump

Posted: Tue 26 Jan 2016 12:45
by damon.cognito
That's great; good work guys!

Re: PgSqlDump

Posted: Fri 05 Feb 2016 13:23
by Pinturiccio
We have fixed the bug with wrong order of view definitions in a backup script created by PgSqlDump. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

Re: PgSqlDump

Posted: Thu 11 Feb 2016 15:30
by Pinturiccio
The new build of dotConnect for PostgreSQL 7.4.592 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=33199