Thread: Error with pgAdmin III backup/restore
I've run into an issue with the default backup/restore of a database in pgAdmin (the one bundled with PostgreSQL 9.02). I am currently running Version 1.12.2 (Dec 14 2010, rev: REL-1_12_2) on PostgreSQL 9.02. The issue has occurred forme on Windows 7 Ultimate (32-bit) and Windows Server 2003 (32-bit R2 Service Pack 2).<br /><br />The error occurs whenI try to backup either one of my PostGIS databases with the default options selected.<br />Format: COMPRESS (No CompressRatio or Encoding specified)<br />Dump Options #1: Only "Blobs" is checked<br /> Dump Options #2: Only "Verbose messages"is checked<br />Objects: All objects are selected (Database, schema, and all tables)<br /><br />My database namescontain no quotes or special characters other than a single underscore (example: Test_Exits, Test_GIS, etc.)<br /><br />------------------------------------------------------------------------------------------------------------------<br />Theerror message I receive when trying to backup is the following:<br /><br />C:/Applications/PostgreSQL/9.0/bin\pg_dump.exe--host localhost --port 5432 --username "postgres" --format custom --blobs--verbose --file "C:\Applications\Test.backup" \"Test_Exits\"<br /> pg_dump: [archiver (db)] connection to database""Test_Exits"" failed: FATAL: database ""Test_Exits"" does not exist<br />pg_dump: *** aborted because of error<br/><br />Process returned exit code 1.<br /> ------------------------------------------------------------------------------------------------------------------<br /><br />------------------------------------------------------------------------------------------------------------------<br />The error message I receive when trying to restore is the following:<br /><br />C:/Applications/PostgreSQL/9.0/bin\pg_restore.exe--host localhost --port 5432 --username postgres --dbname \"Test_Exits\"--verbose "C:\Applications\OpenTMS_Exits.backup"<br /> pg_restore: connecting to database for restore<br />pg_restore:[archiver (db)] connection to database ""Test_Exits"" failed: FATAL: database ""Test_Exits"" does not exist<br/>pg_restore: *** aborted because of error<br /><br />Process returned exit code 1.<br />------------------------------------------------------------------------------------------------------------------<br /><br/>It seemed obvious to me that the escape characters ( \ ) before the double quotes caused the issue. Running the commandsin the psql shell without the two backslashes around the database name caused both the backup and restore to workproperly. I'm wondering if this issue was introduced by the change made for <a href="http://code.pgadmin.org/trac/ticket/266">Ticket#266</a>?<br/>
Le 28/12/2010 03:46, Sean Ayres a écrit : > I've run into an issue with the default backup/restore of a database in > pgAdmin (the one bundled with PostgreSQL 9.02). I am currently running > Version 1.12.2 (Dec 14 2010, rev: REL-1_12_2) on PostgreSQL 9.02. The issue > has occurred for me on Windows 7 Ultimate (32-bit) and Windows Server 2003 > (32-bit R2 Service Pack 2). > > The error occurs when I try to backup either one of my PostGIS databases > with the default options selected. > Format: COMPRESS (No Compress Ratio or Encoding specified) > Dump Options #1: Only "Blobs" is checked > Dump Options #2: Only "Verbose messages" is checked > Objects: All objects are selected (Database, schema, and all tables) > > My database names contain no quotes or special characters other than a > single underscore (example: Test_Exits, Test_GIS, etc.) > > ------------------------------------------------------------------------------------------------------------------ > The error message I receive when trying to backup is the following: > > C:/Applications/PostgreSQL/9.0/bin\pg_dump.exe --host localhost --port 5432 > --username "postgres" --format custom --blobs --verbose --file > "C:\Applications\Test.backup" \"Test_Exits\" > pg_dump: [archiver (db)] connection to database ""Test_Exits"" failed: > FATAL: database ""Test_Exits"" does not exist > pg_dump: *** aborted because of error > > Process returned exit code 1. > ------------------------------------------------------------------------------------------------------------------ > > ------------------------------------------------------------------------------------------------------------------ > The error message I receive when trying to restore is the following: > > C:/Applications/PostgreSQL/9.0/bin\pg_restore.exe --host localhost --port > 5432 --username postgres --dbname \"Test_Exits\" --verbose > "C:\Applications\OpenTMS_Exits.backup" > pg_restore: connecting to database for restore > pg_restore: [archiver (db)] connection to database ""Test_Exits"" failed: > FATAL: database ""Test_Exits"" does not exist > pg_restore: *** aborted because of error > > Process returned exit code 1. > ------------------------------------------------------------------------------------------------------------------ > > It seemed obvious to me that the escape characters ( \ ) before the double > quotes caused the issue. Running the commands in the psql shell without the > two backslashes around the database name caused both the backup and restore > to work properly. I'm wondering if this issue was introduced by the change > made for Ticket#266 <http://code.pgadmin.org/trac/ticket/266>? > I'm able to reproduce this. You're right that the quoting of the database name is not good at all. We need a better way to do this. What I did is almost working. Still need to fix one issue. Anyway, thanks for your report. -- Guillaumehttp://www.postgresql.frhttp://dalibo.com
Le 04/01/2011 02:27, Guillaume Lelarge a écrit : > Le 28/12/2010 03:46, Sean Ayres a écrit : >> I've run into an issue with the default backup/restore of a database in >> pgAdmin (the one bundled with PostgreSQL 9.02). I am currently running >> Version 1.12.2 (Dec 14 2010, rev: REL-1_12_2) on PostgreSQL 9.02. The issue >> has occurred for me on Windows 7 Ultimate (32-bit) and Windows Server 2003 >> (32-bit R2 Service Pack 2). >> >> The error occurs when I try to backup either one of my PostGIS databases >> with the default options selected. >> Format: COMPRESS (No Compress Ratio or Encoding specified) >> Dump Options #1: Only "Blobs" is checked >> Dump Options #2: Only "Verbose messages" is checked >> Objects: All objects are selected (Database, schema, and all tables) >> >> My database names contain no quotes or special characters other than a >> single underscore (example: Test_Exits, Test_GIS, etc.) >> >> ------------------------------------------------------------------------------------------------------------------ >> The error message I receive when trying to backup is the following: >> >> C:/Applications/PostgreSQL/9.0/bin\pg_dump.exe --host localhost --port 5432 >> --username "postgres" --format custom --blobs --verbose --file >> "C:\Applications\Test.backup" \"Test_Exits\" >> pg_dump: [archiver (db)] connection to database ""Test_Exits"" failed: >> FATAL: database ""Test_Exits"" does not exist >> pg_dump: *** aborted because of error >> >> Process returned exit code 1. >> ------------------------------------------------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------------------------------------------ >> The error message I receive when trying to restore is the following: >> >> C:/Applications/PostgreSQL/9.0/bin\pg_restore.exe --host localhost --port >> 5432 --username postgres --dbname \"Test_Exits\" --verbose >> "C:\Applications\OpenTMS_Exits.backup" >> pg_restore: connecting to database for restore >> pg_restore: [archiver (db)] connection to database ""Test_Exits"" failed: >> FATAL: database ""Test_Exits"" does not exist >> pg_restore: *** aborted because of error >> >> Process returned exit code 1. >> ------------------------------------------------------------------------------------------------------------------ >> >> It seemed obvious to me that the escape characters ( \ ) before the double >> quotes caused the issue. Running the commands in the psql shell without the >> two backslashes around the database name caused both the backup and restore >> to work properly. I'm wondering if this issue was introduced by the change >> made for Ticket#266 <http://code.pgadmin.org/trac/ticket/266>? >> > > I'm able to reproduce this. You're right that the quoting of the > database name is not good at all. We need a better way to do this. What > I did is almost working. Still need to fix one issue. > Fixed. Thank you. -- Guillaumehttp://www.postgresql.frhttp://dalibo.com