PostgreSQL: Difference between revisions
m Fix typo |
add a section about monitoring |
||
| Line 178: | Line 178: | ||
With "sameuser" Postgres will allow DB user access only to databases of the same name. E.g. DB user "mydatabase" will get access to database "mydatabase" and nothing else. The part <code>map=superuser_map</code> is optional. | With "sameuser" Postgres will allow DB user access only to databases of the same name. E.g. DB user "mydatabase" will get access to database "mydatabase" and nothing else. The part <code>map=superuser_map</code> is optional. | ||
One exception is the DB user "postgres", which by default is a superuser/admin with access to everything. | One exception is the DB user "postgres", which by default is a superuser/admin with access to everything. | ||
=== Monitoring === | |||
A [[Prometheus]] exporter is available to export metrics to Prometheus-compatible storage.<syntaxhighlight lang="nix"> | |||
services.prometheus.exporters.postgres = { | |||
enable = true; | |||
listenAddress = "0.0.0.0"; | |||
port = 9187; | |||
}; | |||
</syntaxhighlight>[https://search.nixos.org/options?show=services.prometheus.exporters.postgres.dataSourceName&from=0&size=50&sort=relevance&type=packages&query=services.prometheus.exporters.postgres See all available options for services.prometheus.exporters.postgres] | |||
== TLS == | == TLS == | ||