static XLogRecPtr output_fsync_lsn = InvalidXLogRecPtr;
static void usage(void);
-static void StreamLog();
+static void StreamLogicalLog(void);
static void disconnect_and_exit(int code);
static void
* Start the log streaming
*/
static void
-StreamLog(void)
+StreamLogicalLog(void)
{
PGresult *res;
char *copybuf = NULL;
/*
- * stop a replication slot
+ * drop a replication slot
*/
if (do_drop_slot)
{
if (verbose)
fprintf(stderr,
- _("%s: freeing replication slot \"%s\"\n"),
+ _("%s: dropping replication slot \"%s\"\n"),
progname, replication_slot);
snprintf(query, sizeof(query), "DROP_REPLICATION_SLOT \"%s\"",
if (PQntuples(res) != 0 || PQnfields(res) != 0)
{
fprintf(stderr,
- _("%s: could not stop logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
- progname, PQntuples(res), PQnfields(res), 0, 0);
+ _("%s: could not drop replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
+ progname, replication_slot, PQntuples(res), PQnfields(res), 0, 0);
disconnect_and_exit(1);
}
}
/*
- * init a replication slot
+ * create a replication slot
*/
if (do_create_slot)
{
if (verbose)
fprintf(stderr,
- _("%s: initializing replication slot \"%s\"\n"),
+ _("%s: creating replication slot \"%s\"\n"),
progname, replication_slot);
snprintf(query, sizeof(query), "CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"",
if (PQntuples(res) != 1 || PQnfields(res) != 4)
{
fprintf(stderr,
- _("%s: could not init logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
- progname, PQntuples(res), PQnfields(res), 1, 4);
+ _("%s: could not create replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
+ progname, replication_slot, PQntuples(res), PQnfields(res), 1, 4);
disconnect_and_exit(1);
}