PGPASSFILE
environment variable. Here is an example on Windows:
C:\Work>type ./pgpass
# hostname:port:database:username:password
foodbhost:5432:foodb:foouser:foopassword
C:\Work>set PGPASSFILE=./pgpass
C:\Work>psql -U foodbuser -h foodbhost foodb
psql (9.6.3)
Type "help" for help.
foodb=>
Using this method, we help separate the DB authentication and authorization from the application logic.
No comments:
Post a Comment