Re: Remove trailing newlines from pg_upgrade's messages - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Remove trailing newlines from pg_upgrade's messages
Date
Msg-id 20220615.131403.1791191615590453058.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Remove trailing newlines from pg_upgrade's messages  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Remove trailing newlines from pg_upgrade's messages  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At Wed, 15 Jun 2022 13:05:52 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.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



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Remove useless param for create_groupingsets_path
Next
From: Peter Eisentraut
Date:
Subject: Re: Collation version tracking for macOS