Re: psql password prompt

From: Peter Wullinger <some-mail-drop(at)gmx(dot)net>
To: Dmitri Priimak <priimak(at)stanford(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql password prompt
Date: 2004-09-25 17:23:13
Message-ID: 20040925172313.GA3131@peter.home.wul
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2004-09-25 17:38:00 Re: psql password prompt
Previous Message Dmitri Priimak 2004-09-25 16:48:54 psql password prompt