pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
connect to psql without passwd
2+ messages / 2 participants
[nested] [flat]

* connect to psql without passwd
@ 2008-11-03 21:36 Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>
  2008-11-03 21:47 ` Re: connect to psql without passwd Milen A. Radev <milen@radev.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Isabella Ghiurea @ 2008-11-03 21:36 UTC (permalink / raw)
  To: pgsql-admin

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

thank you
Isabella





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: connect to psql without passwd
  2008-11-03 21:36 connect to psql without passwd Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>
@ 2008-11-03 21:47 ` Milen A. Radev <milen@radev.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Milen A. Radev @ 2008-11-03 21:47 UTC (permalink / raw)
  To: pgsql-admin

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-11-03 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 21:36 connect to psql without passwd Isabella Ghiurea <isabella.ghiurea@nrc-cnrc.gc.ca>
2008-11-03 21:47 ` Milen A. Radev <milen@radev.net>

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