+6
nixos/doc/manual/redirects.json
+6
nixos/doc/manual/redirects.json
···
+32
nixos/modules/services/databases/postgresql.md
+32
nixos/modules/services/databases/postgresql.md
···+Local connections are made through unix sockets by default and support [peer authentication](https://www.postgresql.org/docs/current/auth-peer.html).+For example, the `postgres` system user is allowed to login with the database role `postgres`.+In this case, to allow access for a service, you can create a [user name map](https://www.postgresql.org/docs/current/auth-username-maps.html) between system roles and an existing database role.+Assume that your app creates a role `admin` and you want the `root` user to be able to login with it.+You can then use [](#opt-services.postgresql.identMap) to define the map and [](#opt-services.postgresql.authentication) to enable it:+Because PostgreSQL will stop on the first matching line in `pg_hba.conf`, a line matching all roles would lock out other services.
+16
nixos/modules/services/databases/postgresql.nix
+16
nixos/modules/services/databases/postgresql.nix
······
······
+4
-1
nixos/tests/postgresql/postgresql.nix
+4
-1
nixos/tests/postgresql/postgresql.nix
······
······