Received: from europa.fcee.ucp.pt (europa.fcee.ucp.pt [158.162.130.125]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB7HwSP84687 for ; Thu, 7 Dec 2000 12:58:28 -0500 (EST) (envelope-from ricmarques@spamcop.net) Received: from spamcop.net ([158.162.130.58]) by europa.fcee.ucp.pt (8.9.3/8.9.3) with ESMTP id SAA22784; Mon, 7 Dec 2020 18:07:26 GMT Message-ID: <3A2FCE3F.BC6447AE@spamcop.net> Date: Thu, 07 Dec 2000 17:51:59 +0000 From: Ricardo Dias Marques X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: pg_dump backup problems with password authentication References: <3A2F8B85.DF782291@spamcop.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200012/45 X-Sequence-Number: 237 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