Content-Length: 281535 | pFad | http://github.com/postgrespro/postgres_cluster/commit/ffda05977a93f9b3f8a6b05657ba2f16decb6b23

66 Give a proper error message if connecting to incompatible server. · postgrespro/postgres_cluster@ffda059 · GitHub
Skip to content

Commit ffda059

Browse files
committed
Give a proper error message if connecting to incompatible server.
The WAL streaming message format changed in 9.3, so 9.3 pg_basebackup or pg_receivelog won't work against older servers.
1 parent 1b794d3 commit ffda059

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,21 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
342342
int64 last_status = -1;
343343
XLogRecPtr blockpos = InvalidXLogRecPtr;
344344

345+
/*
346+
* The message format used in streaming replication changed in 9.3, so we
347+
* cannot stream from older servers. Don't know if we would work with
348+
* newer versions, but let's not take the risk.
349+
*/
350+
if (PQserverVersion(conn) / 100 != PG_VERSION_NUM / 100)
351+
{
352+
const char *serverver = PQparameterStatus(conn, "server_version");
353+
fprintf(stderr, _("%s: incompatible server version %s; streaming is only supported with server version %s\n"),
354+
progname,
355+
serverver ? serverver : "'unknown'",
356+
PG_MAJORVERSION);
357+
return false;
358+
}
359+
345360
if (sysidentifier != NULL)
346361
{
347362
/* Validate system identifier and timeline hasn't changed */

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/ffda05977a93f9b3f8a6b05657ba2f16decb6b23

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy