Since no decision has been reached in

http://archives.postgresql.org/pgsql-hackers/2006-05/msg00295.php 

I send in the appended documentation patch to fix at least the
documentation. Personally I think that there is no need to invent a new
syntax since we can express everything already with the current one.


Joachim

diff -cr cvs/pgsql/doc/src/sgml/libpq.sgml 
cvs.build/pgsql/doc/src/sgml/libpq.sgml
*** cvs/pgsql/doc/src/sgml/libpq.sgml   2006-05-15 22:59:38.000000000 +0200
--- cvs.build/pgsql/doc/src/sgml/libpq.sgml     2006-05-16 11:13:47.000000000 
+0200
***************
*** 4000,4011 ****
  entries first when you are using wildcards.)
  If an entry needs to contain <literal>:</literal> or
  <literal>\</literal>, escape this character with <literal>\</literal>.
- A hostname of <literal>localhost</> matches both <literal>host</> (TCP)
- and <literal>local</> (Unix domain socket) connections coming from the
- local machine.
  </para>
  
  <para>
  The permissions on <filename>.pgpass</filename> must disallow any
  access to world or group; achieve this by the command
  <command>chmod 0600 ~/.pgpass</command>.
--- 4000,4032 ----
  entries first when you are using wildcards.)
  If an entry needs to contain <literal>:</literal> or
  <literal>\</literal>, escape this character with <literal>\</literal>.
  </para>
  
  <para>
+ To match <literal>local</> (Unix domain socket) connections coming from the
+ local machine, put the path to the Unix domain socket file in the
+ <replaceable>hostname</replaceable> field. So if the socket file you use to
+ access the database is for example
+ <filename>/var/run/postgresql/.s.PGSQL.5432</filename>, you would set
+ <replaceable>hostname</replaceable> to
+ <literal>\/var\/run\/postgresql</literal> and port to <literal>5432</literal>.
+ </para>
+ 
+ <tip>
+ <para>
+ In <application>psql</application> you can always find out the current values
+ of your connection by issuing the <command>\set</command> command. If you want
+ to authenticate this very connection automatically via the
+ <filename>.pgpass</filename> file, just use the shown values for
+ <replaceable>hostname</replaceable>, <replaceable>port</replaceable>,
+ <replaceable>database</replaceable> and <replaceable>username</replaceable>.
+ (Other applications can use the <application>libpq</application> functions
+ described in <xref linkend="libpq-status"> to retrieve the respective values
+ for their current connection.)
+ </para>
+ </tip>
+ 
+ <para>
  The permissions on <filename>.pgpass</filename> must disallow any
  access to world or group; achieve this by the command
  <command>chmod 0600 ~/.pgpass</command>.
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to