Received: from athena.office.vi.net ([194.88.88.225]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB7ELYP67761 for ; Thu, 7 Dec 2000 09:21:37 -0500 (EST) (envelope-from rp@office.vi.net) Received: from rp by athena.office.vi.net with local (Exim 3.12 #1 (Debian)) id 1441vZ-0000qC-00; Thu, 07 Dec 2000 14:21:41 +0000 Date: Thu, 7 Dec 2000 14:21:41 +0000 From: Richard Poole To: Ricardo Dias Marques Cc: pgsql-admin@postgresql.org Subject: Re: pg_dump backup problems with password authentication Message-ID: <20001207142141.B29301@office.vi.net> References: <3A2F8B85.DF782291@spamcop.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <3A2F8B85.DF782291@spamcop.net>; from ricmarques@spamcop.net on Thu, Dec 07, 2000 at 01:07:17PM +0000 X-Archive-Number: 200012/44 X-Sequence-Number: 236 On Thu, Dec 07, 2000 at 01:07:17PM +0000, Ricardo Dias Marques wrote: > So, I did a man pg_dump and found out that -u would prompt > for username and password, and -v would give a verbose output. > And so I did: > pg_dump -u -v dbname > dbname.pgdump > > > The problem is when I press the ENTER key on that command: > it just sits there! Eventually, I have to hit CTRL+C to get out. > > > Can any kind soul explain me what I am doing wrong? :( Unfortunately, the prompts for your username and password come out on standard output, which you're redirecting to the file. So you don't see them. But pg_dump is listening; type in your username and password as if you *had* seen the prompts and it will all work. Alternatively, you can use "echo" to give them: echo -n -e "username\npassword\n" | pg_dump -u -v dbname > dbname.pgdump This is insecure, as your password is briefly visible in a full ps output, but it works non-interactively, so you can do it in scripts (e.g., from cron). Of course, that's potentially even more insecure... Richard