Re: pg_dump backup problems with password authentication

From: Richard Poole <richard(dot)poole(at)vi(dot)net>
To: Ricardo Dias Marques <ricmarques(at)spamcop(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump backup problems with password authentication
Date: 2000-12-07 14:21:41
Message-ID: 20001207142141.B29301@office.vi.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-bugs

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Trurl McByte 2000-12-07 14:42:21 Re: [ADMIN] pg_dump backup problems with password authentication
Previous Message Ricardo Dias Marques 2000-12-07 13:07:17 pg_dump backup problems with password authentication

Browse pgsql-bugs by date

  From Date Subject
Next Message Trurl McByte 2000-12-07 14:42:21 Re: [ADMIN] pg_dump backup problems with password authentication
Previous Message Ricardo Dias Marques 2000-12-07 13:07:17 pg_dump backup problems with password authentication