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);
...
}
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!