pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen A. Radev <milen@radev.net>
To: pgsql-admin@postgresql.org
Subject: Re: connect to psql without passwd
Date: Mon, 03 Nov 2008 23:47:19 +0200
Message-ID: <genrh6$9jh$1@ger.gmane.org> (raw)
In-Reply-To: <490F6EDE.70502@nrc-cnrc.gc.ca>
References: <490F6EDE.70502@nrc-cnrc.gc.ca>

Isabella Ghiurea написа:
> I'm writing a shell script to run analyze and other jobs as use
> postgres, having issues passing the passwd  in psql is always asking for
> password, I'm using .pgpass file as argument in psql ( I understood
> PGPASS is depreciated). My .pgpass file contains only the passwd string 
> not the full connection string9 hostname, port etc) since this is local
> connection , but is  always asking for passwd, using  :PG ver 8.3, RH 5,
> The script contains something like :
> Home=
> PSQL=
> PGDATA=
> export HOME, PSQL, PGDATA etc
> (cat $HOME/.pgpass
> cat << EOF
> REINDEX database test
> ;
> EOF
> ) | $PSQL -U postgres -d test  > /var/lib/pgsql//reindex.log


You need to re-read the relevant page from the manual
(http://www.postgresql.org/docs/current/static/libpq-pgpass.html). You don't
need to supply the content of the file - psql (and all other programmes based
on libpq) will look for it at a predefined place and use it if a few conditions
are met (correct permissions on the file, correct syntax, etc).


-- 
Milen A. Radev




view thread (2+ messages)

Message-ID: <genrh6$9jh$1@ger.gmane.org>
Permalink:  ../genrh6$9jh$1@ger.gmane.org/
Also on:    postgresql.org/message-id/genrh6$9jh$1@ger.gmane.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: milen@radev.net
  Subject: Re: connect to psql without passwd
  In-Reply-To: <genrh6$9jh$1@ger.gmane.org>

* 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