RE: Specifying psql password on command line

From: "Tauren Mills" <tauren(at)servlets(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Specifying psql password on command line
Date: 2001-06-06 06:03:28
Message-ID: NBBBLBKDJMGDNPMDGAABEEBEAEAB.tauren@servlets.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > I've read the documentation for the psql commands as well as
> the createdb
> > and dropdb commands. It looks like there is no way to specify
> the password
> > on the command line. The password is always provided in the
> form of a stdin
> > prompt.
>
> Quite deliberately ... if passwords were provided on the command line,
> then anyone else on your machine could read them off with 'ps'.

I was actually wondering if that was the reason. I know that with MySQL,
the mysql program immediately changes the command line that is displayed
with 'ps' so that you simply see 'xxxxxx' for the password. However, there
is an instant that ps could report the password.

I would think that there would be some way to do this, however. For
instance, specify a file path that contains the password. It seems like
someone out there must be running the command line programs from an
automated script. How are you doing it? Using something like 'expect'?

I'd love to see an example script if anyone has one.

Thanks,
Tauren

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-06-06 06:16:15 Re: Specifying psql password on command line
Previous Message Tauren Mills 2001-06-06 05:59:41 RE: [ADMIN] Alternate database locations