Drop Cascade not happening

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
ccampbell
Posts: 29
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Drop Cascade not happening

Post by ccampbell » Wed 06 Mar 2013 18:15

(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

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Drop Cascade not happening

Post by Pinturiccio » Thu 07 Mar 2013 15:57

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.

ccampbell
Posts: 29
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Re: Drop Cascade not happening

Post by ccampbell » Sun 10 Mar 2013 18:55

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

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Drop Cascade not happening

Post by Pinturiccio » Wed 13 Mar 2013 16:01

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.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Drop Cascade not happening

Post by Pinturiccio » Thu 14 Mar 2013 15:08

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

Post Reply