pg_dumpall -h looks up database names locally.

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_dumpall -h looks up database names locally.
Date: 2000-12-21 20:30:07
Message-ID: 200012212030.eBLKU7349466@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Scott Marlowe (smarlowe(at)ihs(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
pg_dumpall -h looks up database names locally.

Long Description
pg_dumpall -h should dump all the databases on a remote box, but instead appears to be looking up the names of the databases to backup locally, then running the backup of the databases with the same name on the remote host. If both the local and remote machines have the same named databases, then pg_dumpall -h will work.

If the host machine has databases that aren't on the client machine, then those databases will not get backed up, with no error message or any kind.

If the client machine has databases that don't exist on the remote host, then pg_dumpall will fail with an error message that the databases that exist on the client do not exist on the remote host.

Sample Code
host machine has databases named test1 and test2. Client machine has databases named test1, test2, and test3.

client# >pg_dumpall -h remote_host >file.dmp
Connection to database 'test3' failed.
FATAL 1: Database "test3" does not exist in the system catalog.

This bug has been confirmed on two different sets of test machines, both built from source files, one set running 7.0.2 and one set running 7.0.3. They are setup to use "trust" mode authentication (i.e. no authentication at all) and all other operations occurr normally. pg_dump -h hostname databasename works fine across the network.

Luckily the fix is VERY easy, since pg_dumpall is a shell script.

All I had to do was add $1 $2 to each psql command like so:

psql -A -q -t template1

becomes

psql $1 $2 -A -q -t template1

And interestingly, since $1 and $2 are normally empty for local dumps, they don't interfere with those either.

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-21 21:00:24 Re: pg_dumpall -h looks up database names locally.
Previous Message Bruce Momjian 2000-12-21 19:12:01 Re: postgresql process crashes on select * from cmd_sm (which is a view)