Skip to content

Commit

Permalink
Document authentication
Browse files Browse the repository at this point in the history
How to pass the password to the PSQL connection is not obvious from the
current documentation.  Add a basic example with links to the more
documentation.
  • Loading branch information
miohtama authored and blogh committed Dec 17, 2021
1 parent 1a18b42 commit e1639e4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -153,3 +153,16 @@ reporting are still accounted for by postgres in `pg_stat_get_db_xact_commit()`
and `pg_stat_get_db_xact_commit()`. Therefore `pg_activity` will display a non
zero TPS even with no activity on the database, and/or no activity displayed on
screen.

**How can I specify a password for authentication ?**

pg_activity uses libpq to access to PostgreSQL therefore all the traditional
methods are available.

You can pass the password for the database connection in a password file.
Information can also be given via PostgreSQL's environment variables
(PGPASSFILE or PGPASSWORD) or via the connection string parameters.

The password file is preferred since it's more secure (security is deferred to
the OS). Please avoid password in connection strings at all cost.

0 comments on commit e1639e4

Please sign in to comment.