Search code examples
postgresqlpgadmin

pgAdmin launches pg_restore with invalid database name


New install of PostgreSQL and pgAdmin on Ubuntu 11.04 64-bit.

On restoring a database schema with pgAdmin, it launches the following command:

/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname \"mydb\" --verbose "mydb.backup"
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database ""mydb"" failed: FATAL:  database ""mydb"" does not exist
pg_restore: *** aborted because of error

Process returned exit code 1.

The problem is due to the \" before and after the database name. The following works on the command line (note the absent \ characters):

/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname "mydb" --verbose "mydb.backup"

Not sure if pgAdmin is suddenly using a different syntax, or pg_restore doesn't understand the \" anymore. Could it be in any way related to the 64-bit installation of Ubuntu?


Solution

  • Obviously this is a problem with the particular pgadmin3 version: osdir.com/ml/ubuntu-bugs/2011-05/msg30089.html

    The next version shouldn't have this problem anymore.