Re: Error with pgAdmin III backup/restore

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Sean Ayres <sayresvt(at)gmail(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Error with pgAdmin III backup/restore
Date: 2011-01-04 01:27:23
Message-ID: 4D22777B.6010209@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

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.

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Jan-Peter Seifert 2011-01-04 13:13:37 Re: 1.12.1 - cannot dump from older server versions
Previous Message Jan-Peter.Seifert 2011-01-03 12:30:27 Re: 1.12.1 - cannot dump from older server versions