<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pg_ident_file_mappings on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/pg_ident_file_mappings/</link><description>Recent content in Pg_ident_file_mappings on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Tue, 03 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/pg_ident_file_mappings/index.xml" rel="self" type="application/rss+xml"/><item><title>Check pg_ident.conf User Maps with pg_ident_file_mappings</title><link>https://www.postgresscripts.com/post/check-pg-ident-conf-user-maps-with-pg-ident-file-mappings/</link><pubDate>Tue, 03 Nov 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/check-pg-ident-conf-user-maps-with-pg-ident-file-mappings/</guid><description>
&lt;h2 id="check-pg_identconf-user-maps-with-pg_ident_file_mappings"&gt;Check pg_ident.conf User Maps with pg_ident_file_mappings&lt;/h2&gt;
&lt;p&gt;A deploy ships a new pg_ident.conf. The next morning, every peer login from the application host fails with &lt;code&gt;no match in usermap&lt;/code&gt;. The server is up, pg_hba.conf looks right, and the map file is the suspect. The &lt;a href="https://www.postgresql.org/docs/current/view-pg-ident-file-mappings.html"&gt;&lt;code&gt;pg_ident_file_mappings&lt;/code&gt;&lt;/a&gt; view lists the map lines in that file, one row per line, and its &lt;code&gt;error&lt;/code&gt; column says what is wrong with each bad line.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="7945792173"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;pg_ident.conf maps an external user name, such as an operating system login, to a PostgreSQL role. A map has no effect until a pg_hba.conf line names it &lt;a href="https://www.postgresql.org/docs/current/auth-username-maps.html"&gt;with &lt;code&gt;map=map-name&lt;/code&gt; in the options field&lt;/a&gt;. That option works for every authentication method that receives an external user name: &lt;a href="https://thebuild.com/blog/all-your-gucs-in-a-row-identfile/"&gt;ident, peer, gssapi, sspi, cert, and from PostgreSQL 18, oauth&lt;/a&gt;. By default the file is named pg_ident.conf and sits with postgresql.conf in &lt;a href="https://www.postgresql.org/docs/current/runtime-config-file-locations.html"&gt;the directory that &lt;code&gt;-D&lt;/code&gt; or &lt;code&gt;PGDATA&lt;/code&gt; points to&lt;/a&gt;. In a default installation that is the data directory. When &lt;code&gt;data_directory&lt;/code&gt; is set to move the data somewhere else, the configuration files stay where &lt;code&gt;-D&lt;/code&gt; points.&lt;/p&gt;</description></item></channel></rss>