pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Poole <richard.poole@vi.net>
To: Ricardo Dias Marques <ricmarques@spamcop.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump backup problems with password authentication
Date: Thu, 7 Dec 2000 14:21:41 +0000
Message-ID: <20001207142141.B29301@office.vi.net> (raw)
In-Reply-To: <3A2F8B85.DF782291@spamcop.net>
References: <3A2F8B85.DF782291@spamcop.net>

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



view thread (6+ messages)  latest in thread

Message-ID: <20001207142141.B29301@office.vi.net>
Permalink:  ../20001207142141.B29301@office.vi.net/
Also on:    postgresql.org/message-id/20001207142141.B29301@office.vi.net

 · 

reply

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: richard.poole@vi.net, ricmarques@spamcop.net
  Subject: Re: pg_dump backup problems with password authentication
  In-Reply-To: <20001207142141.B29301@office.vi.net>
  References: <3A2F8B85.DF782291@spamcop.net> <20001207142141.B29301@office.vi.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