PgSqlDump restore issue
Posted: Tue 30 Nov 2010 00:41
Hey,
I have a database which contains following tables: user, accessory,company, domain and so on.
I used following code to backup this database, it works fine.
PgSqlConnection conn = new PgSqlConnection( connectionStringBuilder.ConnectionString )
conn.Open();
PgSqlDump pgSqlDump = new PgSqlDump();
pgSqlDump.Connection = conn;
pgSqlDump.Backup( @"c:\backup.dmp" );
conn.Close();
I used following code to restore the database.
PgSqlConnection conn = new PgSqlConnection( connectionStringBuilder.ConnectionString )
conn.Open();
PgSqlDump pgSqlDump = new PgSqlDump();
pgSqlDump.Connection = conn;
pgSqlDump.Restore( @"c:\backup.dmp" );
conn.Close();
The pgSqlDump.Restore throw an exception
"relation "domain" already exists"
Any ideas about this? Thanks.
I have a database which contains following tables: user, accessory,company, domain and so on.
I used following code to backup this database, it works fine.
PgSqlConnection conn = new PgSqlConnection( connectionStringBuilder.ConnectionString )
conn.Open();
PgSqlDump pgSqlDump = new PgSqlDump();
pgSqlDump.Connection = conn;
pgSqlDump.Backup( @"c:\backup.dmp" );
conn.Close();
I used following code to restore the database.
PgSqlConnection conn = new PgSqlConnection( connectionStringBuilder.ConnectionString )
conn.Open();
PgSqlDump pgSqlDump = new PgSqlDump();
pgSqlDump.Connection = conn;
pgSqlDump.Restore( @"c:\backup.dmp" );
conn.Close();
The pgSqlDump.Restore throw an exception
"relation "domain" already exists"
Any ideas about this? Thanks.