Subject: [doc] pg_ctl: fix wrong description for -l

From: Kuroda, Hayato/黒田 隼人<[email-masked]>
Date: Mon, 23 Mar 2026 10:55:03 +0000

Hi hackers,

While investigating codes related with the permissions, I found the below
description in the pg_ctl.

```
-l filename
--log=filename
Append the server log output to filename. If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.
```

But users who are in the same group can also see the log if group permissions are
enabled on the data directory. It was extended by c37b3d0 but updating the doc seemed
to be missed. Attached patch can fix the issue.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

---

From: Andreas Karlsson <[email-masked]>
Date: Sat, 4 Apr 2026 01:15:59 +0200

> to be missed. Attached patch can fix the issue.

Thanks for the patch.

Nicely spotted, but I am not sure I am a fan of the new text. Shouldn't 
we still mention that "If the file does not exist, it is created."? Also 
I think the last sentence would flow better as:

Access to the log file is disallowed to other users by default, but 
users in the same group can also read it if group permissions are 
enabled on the data directory.

Best regards,
Andreas

-- 
Andreas Karlsson
Percona

---

From: Fujii Masao <[email-masked]>
Date: Sat, 11 Apr 2026 01:06:42 +0900

On Sat, Apr 4, 2026 at 8:16 AM Andreas Karlsson <[email-masked]> wrote:
> we still mention that "If the file does not exist, it is created."?

Yes, I think that mention is needed.

> Also

+1

Regards,

-- 
Fujii Masao

---

From: "Hayato Kuroda (Fujitsu)" <[email-masked]>
Date: Mon, 13 Apr 2026 05:20:21 +0000

Dear Andres, Fujii-san,

Thanks for reviewing. Updated accordingly.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

---

From: Xiaopeng Wang <[email-masked]>
Date: Wed, 15 Apr 2026 10:28:28 +0800

> Thanks for reviewing. Updated accordingly.
+1 to fix the doc.

I just feel the new sentence could be further polished a little bit, like:

If the file does not exist, it is created. By default, the log file is not accessible to other users, though members of the same group may be able to read it depending on the data directory permissions.

Regard,
Xiaopeng Wang

---

From: Fujii Masao <[email-masked]>
Date: Thu, 16 Apr 2026 23:38:23 +0900

> If the file does not exist, it is created. By default, the log file is not accessible to other users, though members of the same group may be able to read it depending on the data directory permiss…

"other users" and "members of the same group" sound a bit ambiguous to me.
Would it be clearer to refer explicitly to the cluster owner? For example:

----------------------
Append the server log output to "filename".  If the file does not
exist, it is created.  By default, only the cluster owner can access
the log file.  If group access is enabled in the cluster, users in the
same group as the cluster owner can also read it.
----------------------

Regards,

-- 
Fujii Masao

---

From: "Hayato Kuroda (Fujitsu)" <[email-masked]>
Date: Fri, 17 Apr 2026 01:58:18 +0000

Dear Fujii-san, Xiaopeng,

Thanks for giving comments but late for the reply.
I preferred the Fujii-san's idea, how about Xiaopeng?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

---

From: Xiaopeng Wang <[email-masked]>
Date: Fri, 17 Apr 2026 11:47:34 +0800

> I preferred the Fujii-san's idea, how about Xiaopeng?
Fujii-san’s edit looks good to me.

---

From: Fujii Masao <[email-masked]>
Date: Fri, 17 Apr 2026 15:35:18 +0900

> Fujii-san’s edit looks good to me.

Thanks for the review! So I've updated the patch and pushed it.

Regards,

-- 
Fujii Masao