summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/html/libpq-pgpass.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
commit6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch)
tree657d8194422a5daccecfd42d654b8a245ef7b4c8 /doc/src/sgml/html/libpq-pgpass.html
parentInitial commit. (diff)
downloadpostgresql-13-upstream.tar.xz
postgresql-13-upstream.zip
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/libpq-pgpass.html')
-rw-r--r--doc/src/sgml/html/libpq-pgpass.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/src/sgml/html/libpq-pgpass.html b/doc/src/sgml/html/libpq-pgpass.html
new file mode 100644
index 0000000..6b1b539
--- /dev/null
+++ b/doc/src/sgml/html/libpq-pgpass.html
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>33.15. The Password File</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="libpq-envars.html" title="33.14. Environment Variables" /><link rel="next" href="libpq-pgservice.html" title="33.16. The Connection Service File" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">33.15. The Password File</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="libpq-envars.html" title="33.14. Environment Variables">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="libpq.html" title="Chapter 33. libpq — C Library">Up</a></td><th width="60%" align="center">Chapter 33. <span xmlns="http://www.w3.org/1999/xhtml" class="application">libpq</span> — C Library</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="libpq-pgservice.html" title="33.16. The Connection Service File">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="LIBPQ-PGPASS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">33.15. The Password File</h2></div></div></div><a id="id-1.7.3.22.2" class="indexterm"></a><a id="id-1.7.3.22.3" class="indexterm"></a><p>
+ The file <code class="filename">.pgpass</code> in a user's home directory can
+ contain passwords to
+ be used if the connection requires a password (and no password has been
+ specified otherwise). On Microsoft Windows the file is named
+ <code class="filename">%APPDATA%\postgresql\pgpass.conf</code> (where
+ <code class="filename">%APPDATA%</code> refers to the Application Data subdirectory in
+ the user's profile).
+ Alternatively, a password file can be specified
+ using the connection parameter <a class="xref" href="libpq-connect.html#LIBPQ-CONNECT-PASSFILE">passfile</a>
+ or the environment variable <code class="envar">PGPASSFILE</code>.
+ </p><p>
+ This file should contain lines of the following format:
+</p><pre class="synopsis">
+<em class="replaceable"><code>hostname</code></em>:<em class="replaceable"><code>port</code></em>:<em class="replaceable"><code>database</code></em>:<em class="replaceable"><code>username</code></em>:<em class="replaceable"><code>password</code></em>
+</pre><p>
+ (You can add a reminder comment to the file by copying the line above and
+ preceding it with <code class="literal">#</code>.)
+ Each of the first four fields can be a literal value, or
+ <code class="literal">*</code>, which matches anything. The password field from
+ the first line that matches the current connection parameters will be
+ used. (Therefore, put more-specific entries first when you are using
+ wildcards.) If an entry needs to contain <code class="literal">:</code> or
+ <code class="literal">\</code>, escape this character with <code class="literal">\</code>.
+ The host name field is matched to the <code class="literal">host</code> connection
+ parameter if that is specified, otherwise to
+ the <code class="literal">hostaddr</code> parameter if that is specified; if neither
+ are given then the host name <code class="literal">localhost</code> is searched for.
+ The host name <code class="literal">localhost</code> is also searched for when
+ the connection is a Unix-domain socket connection and
+ the <code class="literal">host</code> parameter
+ matches <span class="application">libpq</span>'s default socket directory path.
+ In a standby server, a database field of <code class="literal">replication</code>
+ matches streaming replication connections made to the master server.
+ The database field is of limited usefulness otherwise, because users have
+ the same password for all databases in the same cluster.
+ </p><p>
+ On Unix systems, the permissions on a password file must
+ disallow any access to world or group; achieve this by a command such as
+ <code class="command">chmod 0600 ~/.pgpass</code>. If the permissions are less
+ strict than this, the file will be ignored. On Microsoft Windows, it
+ is assumed that the file is stored in a directory that is secure, so
+ no special permissions check is made.
+ </p></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="libpq-envars.html" title="33.14. Environment Variables">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="libpq.html" title="Chapter 33. libpq — C Library">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="libpq-pgservice.html" title="33.16. The Connection Service File">Next</a></td></tr><tr><td width="40%" align="left" valign="top">33.14. Environment Variables </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 33.16. The Connection Service File</td></tr></table></div></body></html> \ No newline at end of file