PG_PASSWD(UNIX)
NAME
pg_passwd - manipulate the flat password file
SYNOPSIS
pg_passwd password_file
DESCRIPTION
Pg_passwd is a tool to manipulate the flat password file
functionality of PostgreSQL. Specify the password file in
the same style of Ident authentication in
$PGDATA/pg_hba.conf:
host unv 133.65.96.250 255.255.255.255 password passwd
The above line allows access from 133.65.96.250 using the
passwords listed in $PGDATA/passwd. The format of the
password file follows those of /etc/passwd and
/etc/shadow. The first field is the user name, and the
second field is the encrypted password. The rest is com-
pletely ignored. Thus the following three sample lines
specify the same user and password pair:
pg_guest:/nB7.w5Auq.BY:10031::::::
pg_guest:/nB7.w5Auq.BY:93001:930::/home/guest:/bin/tcsh
pg_guest:/nB7.w5Auq.BY:93001
Supply the password file to the pg_passwd command. In the
case described above, after cd'ing to $PGDATA, the follow-
ing command execution specify the new password for
pg_guest:
% pg_passwd passwd
Username: pg_guest
Password:
Re-enter password:
where the Password: and Re-enter password: prompts require
the same password input which are not displayed on the
terminal. The original password file is renamed to
passwd.bk.
Psql authentication uses the -u option. The following
lines show the sample usage of the option:
% psql -h hyalos -u unv
Username: pg_guest
Password:
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: unv
unv=>
Perl5 authentication uses the new style of the Pg.pm like
this:
$conn = Pg::connectdb("host=hyalos dbname=unv
user=pg_guest password=xxxxxxx");
For more details, refer to src/pgsql_perl5/Pg.pm.
Pg{tcl,tk}sh authentication uses the pg_connect command
with the -conninfo option thus:
% set conn [pg_connect -conninfo \
"host=hyalos dbname=unv \
user=pg_guest password=xxxxxxx "]
Use can list all of the keys for the option by executing
the following command:
% puts [ pg_conndefaults]
FILES
$PGDATA/pg_hba.conf
The Host Based Authentication file
SEE ALSO
psql(1).