aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure4
-rw-r--r--configure.in6
-rw-r--r--doc/src/sgml/libpq.sgml53
3 files changed, 59 insertions, 4 deletions
diff --git a/configure b/configure
index a12e467ae8d..3c7797c02a9 100755
--- a/configure
+++ b/configure
@@ -4743,8 +4743,10 @@ fi
fi
# Supply a numeric version string for use by 3rd party add-ons
+# awk -F is a regex on some platforms, and not on others, so make "." a tab
PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/A-Za-z.*$//' |
-$AWK -F'.' '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
+tr '.' ' ' |
+$AWK '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
cat >>confdefs.h <<_ACEOF
#define PG_VERSION_NUM $PG_VERSION_NUM
diff --git a/configure.in b/configure.in
index b22119f333b..c828b7b1b40 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.452 2006/02/28 21:59:19 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.453 2006/02/28 22:34:24 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -586,8 +586,10 @@ if test "$with_python" = yes; then
fi
# Supply a numeric version string for use by 3rd party add-ons
+# awk -F is a regex on some platforms, and not on others, so make "." a tab
PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
-$AWK -F'.' '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
+tr '.' ' ' |
+$AWK '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
##
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 3fb6a4a85af..48e9a2de3fd 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.201 2005/12/26 14:58:04 petere Exp $
+$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.202 2006/02/28 22:34:24 momjian Exp $
-->
<chapter id="libpq">
@@ -4031,6 +4031,57 @@ however.)
</sect1>
+<sect1 id="libpq-pgservice">
+<title>The Connection Service File</title>
+
+<indexterm zone="libpq-pgservice">
+ <primary>connection service file</primary>
+</indexterm>
+<indexterm zone="libpq-pgservice">
+ <primary>pg_service.conf</primary>
+</indexterm>
+
+<para>
+The file <filename>pg_service.conf</filename> in the <literal>sysconf</>
+directory (typically <filename>/usr/local/pgsql/etc</>) can assocate a
+group of libpq connection parameters with a single service name that
+can be specified in the libpq connection.
+. a user's home directory or the
+file referenced by <envar>PGPASSFILE</envar> 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
+<filename>%APPDATA%\postgresql\pgpass.conf</> (where
+<filename>%APPDATA%</> refers to the Application Data subdirectory in
+the user's profile).
+</para>
+
+<para>
+This file should contain lines of the following format:
+<synopsis>
+<replaceable>hostname</replaceable>:<replaceable>port</replaceable>:<replaceable>database</replaceable>:<replaceable>username</replaceable>:<replaceable>password</replaceable>
+</synopsis>
+Each of the first four fields may be a literal value, or <literal>*</literal>,
+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 <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>.
+If the permissions are less strict than this, the file will be ignored.
+(The file permissions are not currently checked on Microsoft Windows,
+however.)
+</para>
+</sect1>
+
+
<sect1 id="libpq-ssl">
<title>SSL Support</title>