PgSqlDump

PgSqlDump

Postby damon.cognito » Thu 21 Jan 2016 14:53

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!
damon.cognito
 
Posts: 50
Joined: Wed 22 Jul 2009 09:30

Re: PgSqlDump

Postby Pinturiccio » Mon 25 Jan 2016 14:09

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.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: PgSqlDump

Postby damon.cognito » Mon 25 Jan 2016 16:02

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!
damon.cognito
 
Posts: 50
Joined: Wed 22 Jul 2009 09:30

Re: PgSqlDump

Postby Pinturiccio » Tue 26 Jan 2016 10:57

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.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: PgSqlDump

Postby damon.cognito » Tue 26 Jan 2016 12:45

That's great; good work guys!
damon.cognito
 
Posts: 50
Joined: Wed 22 Jul 2009 09:30

Re: PgSqlDump

Postby Pinturiccio » Fri 05 Feb 2016 13:23

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.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: PgSqlDump

Postby Pinturiccio » Thu 11 Feb 2016 15:30

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/postgresql/download.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
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL