Wann sollte ich pg_ident.conf verwenden?
Nutze sie, um eine fehlende Default-Datei wiederherzustellen, zu prüfen, was ausgeliefert wurde, oder sie gegen deine aktuelle PostgreSQL-Config zu diffen.
# PostgreSQL User Name Maps # ========================= # # Refer to the PostgreSQL documentation, chapter "Client # Authentication" for a complete description. A short synopsis # follows. # # This file controls PostgreSQL user name mapping. It maps external # user names to their corresponding PostgreSQL user names. Records # are of the form: # # MAPNAME SYSTEM-USERNAME PG-USERNAME # # (The uppercase quantities must be replaced by actual values.) # # MAPNAME is the (otherwise freely chosen) map name that was used in # pg_hba.conf. SYSTEM-USERNAME is the detected user name of the # client. PG-USERNAME is the requested PostgreSQL user name. The # existence of a record specifies that SYSTEM-USERNAME may connect as # PG-USERNAME. # # If SYSTEM-USERNAME starts with a slash (/), it will be treated as a # regular expression. Optionally this can contain a capture (a # parenthesized subexpression). The substring matching the capture # will be substituted for \1 (backslash-one) if present in # PG-USERNAME. # # Multiple maps may be specified in this file and used by pg_hba.conf. # # No map names are defined in the default configuration. If all # system user names and PostgreSQL user names are the same, you don't # need anything in this file. # # This file is read on server startup and when the postmaster receives # a SIGHUP signal. If you edit the file on a running system, you have # to SIGHUP the postmaster for the changes to take effect. You can # use "pg_ctl reload" to do that. # Put your actual configuration here # ---------------------------------- # MAPNAME SYSTEM-USERNAME PG-USERNAME
curl https://exampleconfig.com/api/v1/config/original/f11c8332d3f444148c0b8ee83ec5fc6d?hint=pg_ident.conf
wget -O pg_ident.conf https://exampleconfig.com/api/v1/config/original/f11c8332d3f444148c0b8ee83ec5fc6d?hint=pg_ident.conf
<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/f11c8332d3f444148c0b8ee83ec5fc6d?hint=pg_ident.conf' /><config><app>PostgreSQL</app><os>Debian 9 (Stretch)</os><location>/etc/postgresql/9.6/main/pg_ident.conf</location><lines>42</lines><md5>f11c8332d3f444148c0b8ee83ec5fc6d</md5><sha256>297f466913f31ff2dcfceea5ccb1a03027db54d9a95270dfd8044cb0c5b016a8</sha256></config></prompt>
Füge es in Claude, ChatGPT oder einen anderen KI-Assistenten ein.
sudo apk add postgresql
sudo apt update && sudo apt install postgresql
sudo yum install postgresql17-server
sudo apt update && sudo apt install postgresql
Wann sollte ich pg_ident.conf verwenden?
Nutze sie, um eine fehlende Default-Datei wiederherzustellen, zu prüfen, was ausgeliefert wurde, oder sie gegen deine aktuelle PostgreSQL-Config zu diffen.
Wie stelle ich die Defaults von PostgreSQL wieder her?
Lad die Datei runter, sichere die aktuelle in /etc/postgresql/9.6/main/pg_ident.conf, ersetze sie und lade PostgreSQL neu oder starte es neu.
Ist pg_ident.conf für den produktiven Einsatz geeignet?
Das ist der Hersteller-Default für Debian 9 (Stretch). Nimm sie als Basis und prüf Security- und Performance-Einstellungen, bevor du sie produktiv nutzt.
Wie unterscheidet sich das von anderen OS-Versionen?
Defaults variieren je nach Distro und Version. Diese Version passt zu Debian 9 (Stretch).
Kann ich das fürs Troubleshooting von PostgreSQL nutzen?
Ja. Diff es gegen deine Version, finde Abweichungen und stell nur die Teile wieder her, die du brauchst.