Page 1 of 1

Drop Cascade not happening

Posted: Wed 06 Mar 2013 18:15
by ccampbell
(VB.Net 2010 / Devart Version 6.5.192.0 / PostgreSQL 9.2.3)

Hi using the following code I created a backup:

Code: Select all

pgDump.Connection = conn
pgDump.Schema = gclsSession.pg_Schema
pgDump.IncludeDrop = True
pgDump.ObjectTypes = PgSqlDumpObjects.Tables + PgSqlDumpObjects.Indexes + PgSqlDumpObjects.Sequences + PgSqlDumpObjects.Constraints + PgSqlDumpObjects.Views
pgDump.Backup(strFullPath)
The restore is failing:

Code: Select all

pgDump.Connection = conn
pgDump.Restore(strFullPath)
stating that it can't drop a view because it's being used by other objects, which is correct but I would expect the drop code to drop cascade the views.

Any ideas on how to deal with this situation?

Thanks,

Chris

Re: Drop Cascade not happening

Posted: Thu 07 Mar 2013 15:57
by Pinturiccio
We will investigate the possibility to solve the problem with dependent objects deletion in PgSqlDump and notify you about the results as soon as possible.

Re: Drop Cascade not happening

Posted: Sun 10 Mar 2013 18:55
by ccampbell
Hey guys, don't lose too much sleep over this one. I found that working within a specific schema avoids the issue. The user was attempting to backup from one schema and restore into another. Something that apparently is not supported.

Thanks,

Chris

Re: Drop Cascade not happening

Posted: Wed 13 Mar 2013 16:01
by Pinturiccio
The issue is reproduced when backing up and restoring within one schema. We have fixed the bug with dropping an object when other objects depend on it during PgSqlDump.Restore(). We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

Re: Drop Cascade not happening

Posted: Thu 14 Mar 2013 15:08
by Pinturiccio
The new build of dotConnect for PostgreSQL 6.5.202 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=26197