Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fdf81c9

Browse files
committed
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.
1 parent 5fa6c81 commit fdf81c9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static XLogRecPtr output_written_lsn = InvalidXLogRecPtr;
5656
static XLogRecPtr output_fsync_lsn = InvalidXLogRecPtr;
5757

5858
static void usage(void);
59-
static void StreamLog();
59+
static void StreamLogicalLog(void);
6060
static void disconnect_and_exit(int code);
6161

6262
static void
@@ -194,7 +194,7 @@ OutputFsync(int64 now)
194194
* Start the log streaming
195195
*/
196196
static void
197-
StreamLog(void)
197+
StreamLogicalLog(void)
198198
{
199199
PGresult *res;
200200
char *copybuf = NULL;
@@ -868,15 +868,15 @@ main(int argc, char **argv)
868868

869869

870870
/*
871-
* stop a replication slot
871+
* drop a replication slot
872872
*/
873873
if (do_drop_slot)
874874
{
875875
char query[256];
876876

877877
if (verbose)
878878
fprintf(stderr,
879-
_("%s: freeing replication slot \"%s\"\n"),
879+
_("%s: dropping replication slot \"%s\"\n"),
880880
progname, replication_slot);
881881

882882
snprintf(query, sizeof(query), "DROP_REPLICATION_SLOT \"%s\"",
@@ -892,8 +892,8 @@ main(int argc, char **argv)
892892
if (PQntuples(res) != 0 || PQnfields(res) != 0)
893893
{
894894
fprintf(stderr,
895-
_("%s: could not stop logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
896-
progname, PQntuples(res), PQnfields(res), 0, 0);
895+
_("%s: could not drop replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
896+
progname, replication_slot, PQntuples(res), PQnfields(res), 0, 0);
897897
disconnect_and_exit(1);
898898
}
899899

@@ -902,15 +902,15 @@ main(int argc, char **argv)
902902
}
903903

904904
/*
905-
* init a replication slot
905+
* create a replication slot
906906
*/
907907
if (do_create_slot)
908908
{
909909
char query[256];
910910

911911
if (verbose)
912912
fprintf(stderr,
913-
_("%s: initializing replication slot \"%s\"\n"),
913+
_("%s: creating replication slot \"%s\"\n"),
914914
progname, replication_slot);
915915

916916
snprintf(query, sizeof(query), "CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"",
@@ -927,8 +927,8 @@ main(int argc, char **argv)
927927
if (PQntuples(res) != 1 || PQnfields(res) != 4)
928928
{
929929
fprintf(stderr,
930-
_("%s: could not init logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
931-
progname, PQntuples(res), PQnfields(res), 1, 4);
930+
_("%s: could not create replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n"),
931+
progname, replication_slot, PQntuples(res), PQnfields(res), 1, 4);
932932
disconnect_and_exit(1);
933933
}
934934

0 commit comments

Comments
 (0)