diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-06-11 10:13:09 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-06-11 10:13:09 +0000 |
commit | e751b71b56f1ba6fa3bb277059f9d5a8ea7b84af (patch) | |
tree | 7444f4c07dd491053adced0ea429074db79480c0 /doc/src | |
parent | c46f861c0dde5813b8c472a65dfc4e76d093ad0f (diff) | |
download | postgresql-e751b71b56f1ba6fa3bb277059f9d5a8ea7b84af.tar.gz postgresql-e751b71b56f1ba6fa3bb277059f9d5a8ea7b84af.zip |
Use "replication" as the database name when constructing a connection
string for a streaming replication connection. It's ignored by the
server, but allows libpq to pick up the password from .pgpass where
"replication" is specified as the database name.
Patch by Fujii Masao per Tom's suggestion, with some wording changes by me.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/high-availability.sgml | 8 | ||||
-rw-r--r-- | doc/src/sgml/libpq.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/recovery-config.sgml | 9 |
3 files changed, 13 insertions, 9 deletions
diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index cc11ce69bd2..2ac79245d02 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.72 2010/06/10 08:13:49 itagaki Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.73 2010/06/11 10:13:08 heikki Exp $ --> <chapter id="high-availability"> <title>High Availability, Load Balancing, and Replication</title> @@ -818,8 +818,10 @@ host replication foo 192.168.1.100/32 md5 </para> <para> The host name and port number of the primary, connection user name, - and password are specified in the <filename>recovery.conf</> file or - the corresponding environment variable on the standby. + and password are specified in the <filename>recovery.conf</> file. + The password can also be set in the <filename>~/.pgpass</> file on the + standby (specify <literal>replication</> in the <replaceable>database</> + field). For example, if the primary is running on host IP <literal>192.168.1.50</>, port <literal>5432</literal>, the superuser's name for replication is <literal>foo</>, and the password is <literal>foopass</>, the administrator diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 57357b18bb2..646cb16cdd1 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.306 2010/05/26 23:49:18 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.307 2010/06/11 10:13:08 heikki Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library</title> @@ -6233,7 +6233,8 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough) A host name of <literal>localhost</> matches both TCP (host name <literal>localhost</>) and Unix domain socket (<literal>pghost</> empty or the default socket directory) connections coming from the local - machine. + machine. In a standby server, a database name of <literal>replication</> + matches streaming replication connections made to the master server. </para> <para> diff --git a/doc/src/sgml/recovery-config.sgml b/doc/src/sgml/recovery-config.sgml index 5bea0f37d6a..d555960b805 100644 --- a/doc/src/sgml/recovery-config.sgml +++ b/doc/src/sgml/recovery-config.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/recovery-config.sgml,v 2.7 2010/06/10 08:13:49 itagaki Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/recovery-config.sgml,v 2.8 2010/06/11 10:13:09 heikki Exp $ --> <chapter Id="recovery-config"> <title>Recovery Configuration</title> @@ -268,9 +268,10 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows primary (see <xref linkend="streaming-replication-authentication">). A password needs to be provided too, if the primary demands password - authentication. (The password can be provided either in - the <varname>primary_conninfo</varname> string or in a separate - <filename>~/.pgpass</> file on the standby server.) + authentication. It can be provided in the + <varname>primary_conninfo</varname> string, or in a separate + <filename>~/.pgpass</> file on the standby server (use + <literal>replication</> as the database name). Do not specify a database name in the <varname>primary_conninfo</varname> string. </para> |