From: Ricardo Dias Marques <ricmarques@spamcop.net>
To: pgsql-admin@postgresql.org
Subject: Re: pg_dump backup problems with password authentication
Date: Thu, 07 Dec 2000 17:51:59 +0000
Message-ID: <3A2FCE3F.BC6447AE@spamcop.net> (raw)
References: <3A2F8B85.DF782291@spamcop.net>
Hi again,
I would like to thank Vasileiadis Spyros, Michael Ansley and
Richard Poole who all pointed out the nature of the problem
and the correct solution.
SUMMARY
The original situation was this:
1) I had changed authentication in pg_hba.conf from trust to
password
2) This gave me a problem with pg_dump
When I ran the command:
pg_dump -D -u -v databasename > database.sql
I didnt't get an Username prompt (the -u switch would do that)
The explanation for this was that the Username prompt appears
in stdout (STanDard OUTput), which *usually* is the screen,
but because I was redirecting output to a file, the Username:
prompt was being saved in the output file (database.sql)
The solution was to write the pg_dump command above, press
ENTER, and then write the username (the Username prompt doesn't
appear, as explained above), press ENTER, write the password
and press ENTER again. Using the -v switch, some lines appear
which show the operations being done (e.g., "reading
user-defined types", "finding Triggers for relation:", etc)
To restore the data, I edited the database.sql with joe
(I found out that my default configuration of pico was
breaking the lines at wrap points). I removed the Username,
and Password lines, and the \connect - postgres line. Then
I wrote the password in the first line (I didn't need to
write the Username, because I was logged in as user
postgres)
Then, I created the new database:
createdb newdatabase
And typed the restore command:
psql newdatabase < database.sql
Et voilá! :)
Thanks for all the help, and I hope this summary will be
useful to other people with the same problem (let me live
in my illusion that I'm not the only one, OK? ;-)
Best wishes,
Ricardo Dias Marques
ricmarques@spamcop.net
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: ricmarques@spamcop.net
Subject: Re: pg_dump backup problems with password authentication
In-Reply-To: <3A2FCE3F.BC6447AE@spamcop.net>
References: <3A2F8B85.DF782291@spamcop.net> <3A2FCE3F.BC6447AE@spamcop.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox