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

Search Discussions

  • Milen A. Radev at Nov 3, 2008 at 9:47 pm

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-admin @
categoriespostgresql
postedNov 3, '08 at 9:36p
activeNov 3, '08 at 9:47p
posts2
users2
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase