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

Started by Alexey Kondratovabout 7 years ago2 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t40869
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 04:03 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t40869_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t40869_1 && git checkout t40869_1

Patchset v1 (message #1) is on t40869_1

Jump to latest
#1Alexey Kondratov
a.kondratov@postgrespro.ru

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]: https://github.com/postgres/postgres/commit/cc8d41511721d25d557fc02a46c053c0a602fed0#diff-c4414062a0071ec15df504d39a6df705R2500
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
https://github.com/postgres/postgres/commit/cc8d41511721d25d557fc02a46c053c0a602fed0#diff-c4414062a0071ec15df504d39a6df705R2500

Regards

--
Alexey Kondratov

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

Attachments:

t40869_1
v1-0001-Fix-usage-of-unified-logging-pg_log_-in-pg_rewind.patchtext/x-patch; name=v1-0001-Fix-usage-of-unified-logging-pg_log_-in-pg_rewind.patchDownload+2-3
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Alexey Kondratov (#1)
Re: Fix two issues after moving to unified logging system for command-line utils

On 2019-07-01 16:18, Alexey Kondratov wrote:

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:

Fixed, thanks.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services