XLogRecPtr serverpos;
TimeLineID servertli;
StreamCtl stream;
+ char *sysidentifier;
MemSet(&stream, 0, sizeof(stream));
* at the same time, necessary if not valid data can be found in the
* existing output directory.
*/
- if (!RunIdentifySystem(conn, NULL, &servertli, &serverpos, NULL))
+ if (!RunIdentifySystem(conn, &sysidentifier, &servertli, &serverpos, NULL))
exit(1);
/*
stream.do_sync);
stream.partial_suffix = ".partial";
stream.replication_slot = replication_slot;
+ stream.sysidentifier = sysidentifier;
ReceiveXlogStream(conn, &stream);
FreeWalDirectoryMethod();
pg_free(stream.walmethod);
+ pg_free(stream.sysidentifier);
}
/*
if (!RunIdentifySystem(conn, NULL, NULL, NULL, &db_name))
exit(1);
- /*
- * Set umask so that directories/files are created with the same
- * permissions as directories/files in the source data directory.
- *
- * pg_mode_mask is set to owner-only by default and then updated in
- * GetConnection() where we get the mode from the server-side with
- * RetrieveDataDirCreatePerm() and then call SetDataDirectoryCreatePerm().
- */
- umask(pg_mode_mask);
-
- /* determine remote server's xlog segment size */
- if (!RetrieveWalSegSize(conn))
- exit(1);
-
/*
* Check that there is a database associated with connection, none should
* be defined in this context.
exit(1);
}
+ /*
+ * Set umask so that directories/files are created with the same
+ * permissions as directories/files in the source data directory.
+ *
+ * pg_mode_mask is set to owner-only by default and then updated in
+ * GetConnection() where we get the mode from the server-side with
+ * RetrieveDataDirCreatePerm() and then call SetDataDirectoryCreatePerm().
+ */
+ umask(pg_mode_mask);
+
/*
* Drop a replication slot.
*/
exit(0);
}
+ /* determine remote server's xlog segment size */
+ if (!RetrieveWalSegSize(conn))
+ exit(1);
+
/*
* Don't close the connection here so that subsequent StreamLog() can
* reuse it.