mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-03 03:07:19 +02:00
pg_recvlogical.c code review.
Several comments still referred to 'initiating', 'freeing', 'stopping' replication slots. These were terms used during different phases of the development of logical decoding, but are no long accurate. Also rename StreamLog() to StreamLogicalLog() and add 'void' to the prototype. Author: Michael Paquier, with some editing by me. Backpatch to 9.4 where pg_recvlogical was introduced.
This commit is contained in:
parent
5fa6c81a43
commit
fdf81c9a6c
@ -56,7 +56,7 @@ static XLogRecPtr output_written_lsn = InvalidXLogRecPtr;
|
|||||||
static XLogRecPtr output_fsync_lsn = InvalidXLogRecPtr;
|
static XLogRecPtr output_fsync_lsn = InvalidXLogRecPtr;
|
||||||
|
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
static void StreamLog();
|
static void StreamLogicalLog(void);
|
||||||
static void disconnect_and_exit(int code);
|
static void disconnect_and_exit(int code);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -194,7 +194,7 @@ OutputFsync(int64 now)
|
|||||||
* Start the log streaming
|
* Start the log streaming
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
StreamLog(void)
|
StreamLogicalLog(void)
|
||||||
{
|
{
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
char *copybuf = NULL;
|
char *copybuf = NULL;
|
||||||
@ -868,7 +868,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* stop a replication slot
|
* drop a replication slot
|
||||||
*/
|
*/
|
||||||
if (do_drop_slot)
|
if (do_drop_slot)
|
||||||
{
|
{
|
||||||
@ -876,7 +876,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: freeing replication slot \"%s\"\n"),
|
_("%s: dropping replication slot \"%s\"\n"),
|
||||||
progname, replication_slot);
|
progname, replication_slot);
|
||||||
|
|
||||||
snprintf(query, sizeof(query), "DROP_REPLICATION_SLOT \"%s\"",
|
snprintf(query, sizeof(query), "DROP_REPLICATION_SLOT \"%s\"",
|
||||||
@ -892,8 +892,8 @@ main(int argc, char **argv)
|
|||||||
if (PQntuples(res) != 0 || PQnfields(res) != 0)
|
if (PQntuples(res) != 0 || PQnfields(res) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: could not stop logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
|
_("%s: could not drop replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
|
||||||
progname, PQntuples(res), PQnfields(res), 0, 0);
|
progname, replication_slot, PQntuples(res), PQnfields(res), 0, 0);
|
||||||
disconnect_and_exit(1);
|
disconnect_and_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -902,7 +902,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init a replication slot
|
* create a replication slot
|
||||||
*/
|
*/
|
||||||
if (do_create_slot)
|
if (do_create_slot)
|
||||||
{
|
{
|
||||||
@ -910,7 +910,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: initializing replication slot \"%s\"\n"),
|
_("%s: creating replication slot \"%s\"\n"),
|
||||||
progname, replication_slot);
|
progname, replication_slot);
|
||||||
|
|
||||||
snprintf(query, sizeof(query), "CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"",
|
snprintf(query, sizeof(query), "CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"",
|
||||||
@ -927,8 +927,8 @@ main(int argc, char **argv)
|
|||||||
if (PQntuples(res) != 1 || PQnfields(res) != 4)
|
if (PQntuples(res) != 1 || PQnfields(res) != 4)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: could not init logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
|
_("%s: could not create replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
|
||||||
progname, PQntuples(res), PQnfields(res), 1, 4);
|
progname, replication_slot, PQntuples(res), PQnfields(res), 1, 4);
|
||||||
disconnect_and_exit(1);
|
disconnect_and_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user