postres services¶
Connecting to Postgres may require a lot of configuration, including user, database, multiple hosts, connection parameters, etc.
Note
Please don;t configure passwords clear text in configuration files!!!
PostgreSQL clients can be used with a pg_service.conf file to configure services, where every service represents a connection with different setting.
PgVillage creates a ~postgres/pg_service.conf file whichh conatins all types of connections that the linux user for the postgres service could require.
Example
[local] host=/tmp port=5432
[proxy] host=127.0.01 port=25432 sslmode=verify-full
[master] host=host1.mydomain.org,host2.mydomain.org,host3.mydomain.org port=5432 target_session_attrs=read-write sslmode=verify-full
[standby] host=host1.mydomain.org,host2.mydomain.org,host3.mydomain.org port=5432 target_session_attrs=read-write
Background¶
For more information, please refer to PostgreSQL docs.