Unquoted file name in an error message

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Unquoted file name in an error message
Date: 2025-04-07 06:27:21
Message-ID: 20250407.152721.1397761902317499205.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

While translating error messages related to pg_dumpall (1495eff7bdb),
I noticed that one message lacks double quotes around the file name:

could not open map file: %s

Since this placeholder appears standalone and not embedded in a
sentence, I initially thought it might fall outside the usual
convention of quoting file names. However, a similar message added to
pg_restore does quote the file name, as in:

could not open global.dat file: "%s"

So I believe this omission is unintentional.

The first of the attached patches adds double quotes around the file
name for consistency.

In addition, I noticed that pg_dump and pg_restore refer to map.dat
using different wording. The second patch updates the message to
refer to "map.dat file" instead of "map file", for consistency with
how pg_restore refers to both "global.dat file" and "map.dat file"
explicitly.

I noticed that there are other messages in other files that refer to
file names without quotes as well, but I'm not addressing those here.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Quote-file-names-in-error-messages.patch text/x-patch 1.2 KB
0002-Use-map.dat-file-instead-of-map-file-in-error-messag.patch text/x-patch 1.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-04-07 06:31:14 Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits
Previous Message Daniil Davydov 2025-04-07 06:26:25 Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM