R: psql in Batch mode and passwords?

From: "Stefano Coletta" <coletta(at)xmedia(dot)net>
To: "Michael A(dot) Schulte" <michael(dot)schulte(at)sun(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: R: psql in Batch mode and passwords?
Date: 2002-07-09 15:19:33
Message-ID: 350E062B37CE88409BB2489A029853266D2DA9@POSTINO.intranet.xmedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

You can try with:

echo password | psql ...

But if you are using Pgsql 7.2.1 it will not work (in fact postgres 7.2.1 is getting passwords from /dev/tty instead of stdin).

However I posted here in the admin-list a patch to the postgres 7.2.1 C code to make it work with stdin, like the older versions.

Hope it helps.

--------------------------------------------------
xmedia
New Media Agency
--------------------------------------------------
Stefano Coletta <mailto:coletta(at)xmedia(dot)net>
Network Admin <http://www.xmedia.net>
via Francesco Benaglia, 13 - Tel. +39 06 588851
00153 Roma Italy fax +39 06 58885016
--------------------------------------------------

> -----Messaggio originale-----
> Da: Michael A. Schulte [mailto:michael(dot)schulte(at)sun(dot)com]
> Inviato: martedì 9 luglio 2002 10.52
> A: pgsql-admin(at)postgresql(dot)org
> Oggetto: [ADMIN] psql in Batch mode and passwords?
>
>
> Hi,
>
> does anyone have an idea how to convince psql
> to accept a password that is passed during startup
> of psql in the command line?
>
> I don't want to modify pg_hba.conf so that it
> is open for everyone so I have inserted:
>
> local all trust
> host all 129.157.0.0 255.255.0.0 password
>
>
> I look for something like:
> psql -h somehost -a dash anonymous/anonym
> where there exists a postgres user named "anonymous"
> and the password is anonym.
>
> Best regards,
> Michael
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an
> appropriate subscribe-nomail command to
> majordomo(at)postgresql(dot)org so that your message can get through
> to the mailing list cleanly
>
>
>

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Brannen 2002-07-09 15:22:35 Re: psql in Batch mode and passwords?
Previous Message Stephan Szabo 2002-07-09 15:17:40 Re: multiple primary keys