Incorrect log message and checks in pgrecvlogical

Started by Michael Paquierover 11 years ago2 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi,

While looking at pg_recvlogical code, I noticed that a couple of error
messages are incorrect when invoking some combinations of --create,
--start or --drop.

For example, here --init should be --create, --stop should be --drop:
$ pg_recvlogical --create --drop --slot foo
pg_recvlogical: cannot use --init or --start together with --stop
Try "pg_recvlogical --help" for more information.

Also, when checking the combination startpos && (create || drop), I
think that we should check that startpos is InvalidXLogRecPtr.

The patch attached fixes all those things. It should be back-patched to 9.4.
Regards,
--
Michael

Attachments:

20140812_pg_recvllog_fix.patchtext/x-patch; charset=US-ASCII; name=20140812_pg_recvllog_fix.patchDownload+3-3
#2Andres Freund
andres@anarazel.de
In reply to: Michael Paquier (#1)
Re: Incorrect log message and checks in pgrecvlogical

On 2014-08-12 16:28:56 +0900, Michael Paquier wrote:

Hi,

While looking at pg_recvlogical code, I noticed that a couple of error
messages are incorrect when invoking some combinations of --create,
--start or --drop.

For example, here --init should be --create, --stop should be --drop:
$ pg_recvlogical --create --drop --slot foo
pg_recvlogical: cannot use --init or --start together with --stop
Try "pg_recvlogical --help" for more information.

Also, when checking the combination startpos && (create || drop), I
think that we should check that startpos is InvalidXLogRecPtr.

The patch attached fixes all those things. It should be back-patched to 9.4.

Thanks, applied.

Andres

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers