Commit 75867c52 authored by Simon Riggs's avatar Simon Riggs

Minor tweaks on libpqrcv_connect(): ensure conninfo_repl[] is

correctly sized and expand comment to explain otherwise
undocumented use of replication connection parameter.
parent aa36bd20
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.5 2010/02/26 02:00:58 momjian Exp $ * $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.6 2010/03/19 17:51:42 sriggs Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -76,7 +76,7 @@ _PG_init(void) ...@@ -76,7 +76,7 @@ _PG_init(void)
static bool static bool
libpqrcv_connect(char *conninfo, XLogRecPtr startpoint) libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
{ {
char conninfo_repl[MAXCONNINFO + 14]; char conninfo_repl[MAXCONNINFO + 18];
char *primary_sysid; char *primary_sysid;
char standby_sysid[32]; char standby_sysid[32];
TimeLineID primary_tli; TimeLineID primary_tli;
...@@ -84,7 +84,7 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint) ...@@ -84,7 +84,7 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
PGresult *res; PGresult *res;
char cmd[64]; char cmd[64];
/* Connect */ /* Connect using deliberately undocumented parameter: replication */
snprintf(conninfo_repl, sizeof(conninfo_repl), "%s replication=true", conninfo); snprintf(conninfo_repl, sizeof(conninfo_repl), "%s replication=true", conninfo);
streamConn = PQconnectdb(conninfo_repl); streamConn = PQconnectdb(conninfo_repl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment