Re: Remove trailing newlines from pg_upgrade's messages

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Remove trailing newlines from pg_upgrade's messages
Date: 2022-06-15 04:14:03
Message-ID: 20220615.131403.1791191615590453058.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 15 Jun 2022 13:05:52 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> By the way, I noticed that pg_upgrade complains wrong way when the
> specified binary path doesn't contain "postgres" file.
>
> $ pg_upgrade -b /tmp -B /tmp -d /tmp -D /tmp
>
> check for "/tmp/postgres" failed: not a regular file
> Failure, exiting
>
> I think it should be a quite common mistake to specify the parent
> directory of the binary directory..

FWIW, the following change makes sense to me according to the spec of
validate_exec()...

diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c
index fadeea12ca..3cff186213 100644
--- a/src/bin/pg_upgrade/exec.c
+++ b/src/bin/pg_upgrade/exec.c
@@ -430,10 +430,10 @@ check_exec(const char *dir, const char *program, bool check_version)
ret = validate_exec(path);

if (ret == -1)
- pg_fatal("check for \"%s\" failed: not a regular file\n",
+ pg_fatal("check for \"%s\" failed: does not exist or inexecutable\n",
path);
else if (ret == -2)
- pg_fatal("check for \"%s\" failed: cannot execute (permission denied)\n",
+ pg_fatal("check for \"%s\" failed: cannot read (permission denied)\n",
path);

snprintf(cmd, sizeof(cmd), "\"%s\" -V", path);

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-06-15 05:27:44 Re: Collation version tracking for macOS
Previous Message Richard Guo 2022-06-15 04:12:00 Re: Remove useless param for create_groupingsets_path