Fix two issues after moving to unified logging system for command-line utils

From: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Fix two issues after moving to unified logging system for command-line utils
Date: 2019-07-01 15:18:33
Message-ID: adb41f24-9bf6-7eb3-77de-52a172ef5f4c@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I have found two minor issues with unified logging system for
command-line programs (commited by Peter cc8d415117), while was rebasing
my pg_rewind patch:

1) forgotten new-line symbol in pg_fatal call inside pg_rewind, which
will cause the following Assert in common/logging.c to fire

Assert(fmt[strlen(fmt) - 1] != '\n');

It seems not to be a problem for a production Postgres installation
without asserts, but should be removed for sanity.

2) swapped progname <-> full_path in initdb.c setup_bin_paths's call
[1], while logging message remained the same. So the output will be
rather misleading, since in the pg_ctl and pg_dumpall the previous order
is used.

Attached is a small patch that fixes these issues.

[1]
https://github.com/postgres/postgres/commit/cc8d41511721d25d557fc02a46c053c0a602fed0#diff-c4414062a0071ec15df504d39a6df705R2500

Regards

--
Alexey Kondratov

Postgres Professional https://www.postgrespro.com
Russian Postgres Company

Attachment Content-Type Size
v1-0001-Fix-usage-of-unified-logging-pg_log_-in-pg_rewind.patch text/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-07-01 15:28:12 Re: [HACKERS] Custom compression methods
Previous Message Konstantin Knizhnik 2019-07-01 15:11:26 Re: Built-in connection pooler