pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Hemapriya <priyam_1121@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Connect to postgres from a script using password
Date: Thu, 8 Jul 2004 11:47:36 -0500
Message-ID: <20040708164736.GA5140@wolff.to> (raw)
In-Reply-To: <20040708160730.73409.qmail@web21326.mail.yahoo.com>
References: <20040708160730.73409.qmail@web21326.mail.yahoo.com>

On Thu, Jul 08, 2004 at 09:07:30 -0700,
  Hemapriya <priyam_1121@yahoo.com> wrote:
> Hi,
> 
> Can anyone tell me how to connect to postgres from a
> shell script using password. If i use psql -UUser db
> -W option it prompts for password everytime.. 
> Is there anyway we can have the password included in
> psql login command.?

You can keep the password in ~/.pgpass or you can use ident authentication.
In at least some versions you can pass it through an environment variable,
but you don't want to do that if there are untrusted users with shell
access to the host, as environment variables are typically visible to other
users.



view thread (3+ messages)

Message-ID: <20040708164736.GA5140@wolff.to>
Permalink:  ../20040708164736.GA5140@wolff.to/
Also on:    postgresql.org/message-id/20040708164736.GA5140@wolff.to

 · 

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: bruno@wolff.to, priyam_1121@yahoo.com
  Subject: Re: Connect to postgres from a script using password
  In-Reply-To: <20040708164736.GA5140@wolff.to>
  References: <20040708160730.73409.qmail@web21326.mail.yahoo.com> <20040708164736.GA5140@wolff.to>

* 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