1. + { + appendStringInfo(&cmd, " WITH (FORMAT binary)");
We could use appendStringInfoString here.
Done.
2. I think it would be better to pass the log offset when using wait_for_log, because otherwise it will check the whole log file to find the target message, This might not be a big problem, but it has a risk of getting unexpected log message which was generated by previous commands.
You're right. I added offsets for wait_for_log's .