1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Remove PGPASSWORDFILE and default to always trying $HOME/.pgpass.

Cleanup up memory allocation for $HOME in related psql places.

Update mention of $HOME/.pgpass in the docs;  add mention in pg_dumpall.
This commit is contained in:
Bruce Momjian
2002-09-05 22:05:50 +00:00
parent f4aecac468
commit 5fc10c3d17
7 changed files with 92 additions and 57 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.94 2002/09/02 20:21:32 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.95 2002/09/05 22:05:48 momjian Exp $
-->
<chapter id="libpq">
@ -2052,23 +2052,6 @@ reasons; consider migrating to <envar>PGPASSWORDFILE</envar>.
</listitem>
<listitem>
<para>
<indexterm>
<primary><envar>PGPASSWORDFILE</envar></primary>
</indexterm>
<envar>PGPASSWORDFILE</envar>
sets the password file used if the backend demands password authentication.
This file should have the format
<screen>
<replaceable>hostname</replaceable>:<replaceable>port</replaceable>:<replaceable>database</replaceable>:<replaceable>username</replaceable>:<replaceable>password</replaceable>
</screen>
Any of these may be a literal name, or a <literal>*</literal> that matches
anything. The first match will be the one used, so put more specific entries first.
Entries with <literal>:</literal> or <literal>\</literal> should be escaped
with <literal>\</literal>.
</para>
</listitem>
<listitem>
<para>
<envar>PGREALM</envar> sets the Kerberos realm to use with
<productname>PostgreSQL</productname>, if it is different from the local realm.
If <envar>PGREALM</envar> is set, <productname>PostgreSQL</productname>
@ -2141,6 +2124,27 @@ for information on correct values for these environment variables.
</sect1>
<sect1 id="libpq-files">
<title>Files</title>
<indexterm zone="libpq-files">
<primary>files</primary>
</indexterm>
<para>
<filename>$HOME/.pgpass</filename> is a file that can contain passwords
to be used if the connection requires a password. This file should have the
format:
<screen>
<replaceable>hostname</replaceable>:<replaceable>port</replaceable>:<replaceable>database</replaceable>:<replaceable>username</replaceable>:<replaceable>password</replaceable>
</screen>
Any of these may be a literal name, or <literal>*</literal>, which matches
anything. The first match will be used so put more specific entries first.
Entries with <literal>:</literal> or <literal>\</literal> should be escaped
with <literal>\</literal>.
</para>
</sect1>
<sect1 id="libpq-threading">
<title>Threading Behavior</title>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.2 2002/09/03 01:11:37 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.3 2002/09/05 22:05:50 momjian Exp $
PostgreSQL documentation
-->
@ -54,10 +54,10 @@ PostgreSQL documentation
</para>
<para>
<application>clusterdb</application> will need to connect several times to the
<productname>PostgreSQL</productname> server. If you are using password
authentication, it will ask for the password each time. It will probably be
very convenient to have a PGPASSWORDFILE in that case.
<application>clusterdb</application> might need to connect several
times to the <productname>PostgreSQL</productname> server, asking for
a password each time. It is convenient to have a
<filename>$HOME/.pgpass</> file in such cases.
</para>
</refsect1>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.32 2002/08/27 18:57:26 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.33 2002/09/05 22:05:50 momjian Exp $
PostgreSQL documentation
-->
@ -61,6 +61,14 @@ PostgreSQL documentation
The SQL script will be written to the standard output. Shell
operators should be used to redirect it into a file.
</para>
<para>
<application>pg_dumpall</application> might need to connect several
times to the <productname>PostgreSQL</productname> server, asking for
a password each time. It is convenient to have a
<filename>$HOME/.pgpass</> file in such cases.
</para>
</refsect1>
<refsect1>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.24 2002/08/27 03:55:17 momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.25 2002/09/05 22:05:50 momjian Exp $
PostgreSQL documentation
-->
@ -62,9 +62,10 @@ PostgreSQL documentation
<para>
<application>vacuumdb</application> will need to connect several times to the
<productname>PostgreSQL</productname> server, asking for the password each
time. It will probably be very convenient to have a PGPASSWORDFILE in that case.
<application>vacuumdb</application> might need to connect several
times to the <productname>PostgreSQL</productname> server, asking for
a password each time. It is convenient to have a
<filename>$HOME/.pgpass</> file in such cases.
</para>
</refsect1>