Schema location issue with pgDump & Restore
Posted: Tue 14 Sep 2010 19:11
Hi,
Using: devart.data 5.0.99.0
devart.data.postgresql 4.95.146.0
Postgres v8.4.4
I’m having an issue with the pgDump in that the schema under my database is getting restored to the public database rather than the database it belongs under, for example:
Here is my original cluster structure
Databases(2)
--DDir000
----schemas(2)
--------data1
--------public
--postgres
----Schemas(1)
--------Public
However, after I do a restore, the data1 schema is loaded under the postgres database rather than DDir000 where is belongs:
Databases(2)
--DDir000
----Schemas(1)
--------public
--postgres
----Schemas(2)
--------Data1
--------Public
On the Backup, my data connection is attached to DDir000
On the Restore, my data connection is attached to postgres (because DDir000 doesn't exist yet)
The restore is occuring in a clean install of Postgres
Here is my code:
// === Create the Dump file
pgDump.Connection = conn
pgDump.ObjectTypes = PgSqlDumpObjects.All - PgSqlDumpObjects.Languages
pgDump.CreateConstraints = False
pgDump.Schema = ""
pgDump.Tables = ""
pgDump.IncludeDrop = False
pgDump.Mode = DumpMode.All
pgDump.Backup()
Dim stream As StreamWriter = New StreamWriter(gstrTempPath & "\sqldump.dmp")
stream.WriteLine(pgDump.DumpText)
stream.Close()
// === Restore the dump file into new install of Postgres
Dim pgDump As PgSqlDump = New PgSqlDump
pgDump.Connection = conn
pgDump.Restore(gstrTempPath & "\sqldump.dmp")
Am I missing a setting somewhere?
Thanks,
Chris
Using: devart.data 5.0.99.0
devart.data.postgresql 4.95.146.0
Postgres v8.4.4
I’m having an issue with the pgDump in that the schema under my database is getting restored to the public database rather than the database it belongs under, for example:
Here is my original cluster structure
Databases(2)
--DDir000
----schemas(2)
--------data1
--------public
--postgres
----Schemas(1)
--------Public
However, after I do a restore, the data1 schema is loaded under the postgres database rather than DDir000 where is belongs:
Databases(2)
--DDir000
----Schemas(1)
--------public
--postgres
----Schemas(2)
--------Data1
--------Public
On the Backup, my data connection is attached to DDir000
On the Restore, my data connection is attached to postgres (because DDir000 doesn't exist yet)
The restore is occuring in a clean install of Postgres
Here is my code:
// === Create the Dump file
pgDump.Connection = conn
pgDump.ObjectTypes = PgSqlDumpObjects.All - PgSqlDumpObjects.Languages
pgDump.CreateConstraints = False
pgDump.Schema = ""
pgDump.Tables = ""
pgDump.IncludeDrop = False
pgDump.Mode = DumpMode.All
pgDump.Backup()
Dim stream As StreamWriter = New StreamWriter(gstrTempPath & "\sqldump.dmp")
stream.WriteLine(pgDump.DumpText)
stream.Close()
// === Restore the dump file into new install of Postgres
Dim pgDump As PgSqlDump = New PgSqlDump
pgDump.Connection = conn
pgDump.Restore(gstrTempPath & "\sqldump.dmp")
Am I missing a setting somewhere?
Thanks,
Chris