Re: psql password prompt - Mailing list pgsql-general

From Peter Wullinger
Subject Re: psql password prompt
Date
Msg-id 20040925172313.GA3131@peter.home.wul
Whole thread Raw
In response to psql password prompt  (Dmitri Priimak <priimak@stanford.edu>)
List pgsql-general
In epistula a Dmitri Priimak, die horaque Sat, Sep 25, 2004 at 09:48:54AM -0700:
> Hi All.
>
> There is one thing which somewhat annoys me, which is that psql always
> prompts me for a password.
> That makes it difficult for use in Makefile where I want to say 'make
> build_db', which would run psql for
> each stored procedure which needs to be updated.

In that case, I would dump all operations into an SQL script
and run psql once from that script, if possible.

Other options (ranging from totally insecure to more secure
than password authentication and from easy to complex in
implementation) are available, if you have administrative
control over the PostgreSQL-server:

- completely disable authentication (in $PG_DATA/pg_hba.conf)
- disable authentication for your machine only
- run the update commands on the same machine as PostgreSQL runs
  and set the Unix domain socket to "ident sameuser" authentication
- use kerberos authentication

Otherwise I do not know of any other possibility to resolve
your problem other than hacking psql and implementing the
desired parameter.

> Is there a way to
> specify that password somehow in a
> command line like isql ( sybase cli client ) does?

That would be truly poor idea. The command line of any process is
normally visible to every user on the system via the `ps' command:

== password.sh ==
#! /bin/sh
sleep 10
== password.sh ==

% sh password.sh & sleep 1; ps | grep password
 3233  p2  SN+    0:00,01 sh password.sh --password myPassword

Cheers,
    Peter

--
Wir leben in einer Welt, worin ein Narr viele Narren, aber ein weiser
Mann nur wenige Weise macht.
    -- Immanuel Kant

pgsql-general by date:

Previous
From: Dmitri Priimak
Date:
Subject: psql password prompt
Next
From: John DeSoi
Date:
Subject: Re: psql password prompt