pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postmaster.pid also contains shared memory key
8+ messages / 6 participants
[nested] [flat]

Commits from this thread:
  2026-11-02 1a29680f9b  doc: Clarify the description of postmaster.pid fields
  2026-11-01 fa5ecff759  doc: Add missing field description for postmaster.pid
* postmaster.pid also contains shared memory key
@ 2026-10-27 20:56 PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 8+ messages in thread

From: PG Doc comments form @ 2026-10-27 20:56 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: yong321@yahoo.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/storage-file-layout.html
Description:

On this page, postmaster.pid is said to contain "shared memory segment ID".
It would be better to say "shared memory segment key and ID". The second
last line has two numbers, which are the shared memory segment key (in
decimal instead of hex) and ID, respectively. This can be verified with
`ipcs -m'. If you only say "ID", readers may ask, Which one is the ID?







^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
@ 2026-10-31 00:21 ` Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Michael Paquier @ 2026-10-31 00:21 UTC (permalink / raw)
  To: yong321@yahoo.com; pgsql-docs@lists.postgresql.org

On Tue, Oct 27, 2026 at 08:56:24PM +0000, PG Doc comments form wrote:
> On this page, postmaster.pid is said to contain "shared memory segment ID".
> It would be better to say "shared memory segment key and ID". The second
> last line has two numbers, which are the shared memory segment key (in
> decimal instead of hex) and ID, respectively. This can be verified with
> `ipcs -m'. If you only say "ID", readers may ask, Which one is the ID?

Would you like to write a patch?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
@ 2026-11-01 01:56   ` Yong Huang <yong321@yahoo.com>
  2026-11-01 12:44     ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 8+ messages in thread

From: Yong Huang @ 2026-11-01 01:56 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

 Hi Michael,
The proposed change is too trivial. I just want to inform the documentation team. Most readers won't care anyway. Thank you!
Yong Huang
    On Friday, October 30, 2026 at 07:21:41 PM CDT, Michael Paquier <michael@paquier.xyz> wrote:  
 
 On Tue, Oct 27, 2026 at 08:56:24PM +0000, PG Doc comments form wrote:
> On this page, postmaster.pid is said to contain "shared memory segment ID".
> It would be better to say "shared memory segment key and ID". The second
> last line has two numbers, which are the shared memory segment key (in
> decimal instead of hex) and ID, respectively. This can be verified with
> `ipcs -m'. If you only say "ID", readers may ask, Which one is the ID?

Would you like to write a patch?
--
Michael
  

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
@ 2026-11-01 12:44     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2026-11-01 19:16       ` Re: postmaster.pid also contains shared memory key Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 8+ messages in thread

From: Laurenz Albe @ 2026-11-01 12:44 UTC (permalink / raw)
  To: Yong Huang <yong321@yahoo.com>; pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

On Sun, 2026-11-01 at 01:56 +0000, Yong Huang wrote:
> On Friday, October 30, 2026 at 07:21:41 PM CDT, Michael Paquier <michael@paquier.xyz> wrote: 
> > On Tue, Oct 27, 2026 at 08:56:24PM +0000, PG Doc comments form wrote:
> > > On this page, postmaster.pid is said to contain "shared memory segment ID".
> > > It would be better to say "shared memory segment key and ID". The second
> > > last line has two numbers, which are the shared memory segment key (in
> > > decimal instead of hex) and ID, respectively. This can be verified with
> > > `ipcs -m'. If you only say "ID", readers may ask, Which one is the ID?
> >
> > Would you like to write a patch?
>
> The proposed change is too trivial. I just want to inform the documentation team.
> Most readers won't care anyway. Thank you!

Nothing is too trivial.  I do care - here is a patch.

Yours,
Laurenz Albe

Attachments:

v1-0001-Improve-documentation-for-postmaster.pid.patch (text/x-patch, 1.2K) download From cac82bc180613f9097e941f4c7a44f09fee419dd Mon Sep 17 00:00:00 2001 From: Laurenz Albe <laurenz.albe@cybertec.at> Date: Sun, 1 Nov 2026 13:42:29 +0100 Subject: [PATCH v1] Improve documentation for postmaster.pid The description mentioned that the file contains the shared memory segment ID, but forgot to mention the shared memory segment key reported on the same line. This could cause confusion. Author: Laurenz Albe <laurenz.albe@cybertec.at> Reported-By: Yong Huang <yong321@yahoo.com> Discussion: https://postgr.es/m/179313458417.1253.445225696660341760%40wrigleys.postgresql.org --- doc/src/sgml/storage.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index 83de016eaa5..5612e9868a6 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -174,7 +174,7 @@ last started with</entry> Unix-domain socket directory path (could be empty), first valid listen_address (IP address or <literal>*</literal>, or empty if not listening on TCP), - and shared memory segment ID + and shared memory segment key and ID (this file is not present after server shutdown)</entry> </row> -- 2.56.0
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
  2026-11-01 12:44     ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
@ 2026-11-01 19:16       ` Daniel Gustafsson <daniel@yesql.se>
  2026-11-02 00:21         ` Re: postmaster.pid also contains shared memory key Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Daniel Gustafsson @ 2026-11-01 19:16 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Yong Huang <yong321@yahoo.com>; pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

> On 1 Nov 2026, at 13:44, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> 
> On Sun, 2026-11-01 at 01:56 +0000, Yong Huang wrote:
>> On Friday, October 30, 2026 at 07:21:41 PM CDT, Michael Paquier <michael@paquier.xyz> wrote:
>>> On Tue, Oct 27, 2026 at 08:56:24PM +0000, PG Doc comments form wrote:
>>>> On this page, postmaster.pid is said to contain "shared memory segment ID".
>>>> It would be better to say "shared memory segment key and ID". The second
>>>> last line has two numbers, which are the shared memory segment key (in
>>>> decimal instead of hex) and ID, respectively. This can be verified with
>>>> `ipcs -m'. If you only say "ID", readers may ask, Which one is the ID?
>>> 
>>> Would you like to write a patch?
>> 
>> The proposed change is too trivial. I just want to inform the documentation team.
>> Most readers won't care anyway. Thank you!
> 
> Nothing is too trivial.  I do care - here is a patch.

Pushed, thanks.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
  2026-11-01 12:44     ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
  2026-11-01 19:16       ` Re: postmaster.pid also contains shared memory key Daniel Gustafsson <daniel@yesql.se>
@ 2026-11-02 00:21         ` Fujii Masao <masao.fujii@gmail.com>
  2026-11-02 05:05           ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 8+ messages in thread

From: Fujii Masao @ 2026-11-02 00:21 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Yong Huang <yong321@yahoo.com>; pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

On Mon, Nov 2, 2026 at 4:16 AM Daniel Gustafsson <daniel@yesql.se> wrote:
> Pushed, thanks.

Thanks for working on this!

I think it's better to also clarify the postmaster status and note that
the shared memory field is empty on Windows. Attached is a follow-up
patch documenting both and adding the segment ID to the pidfile.h comment.
Thought?

Regards,

-- 
Fujii Masao

Attachments:

v1-0001-doc-Clarify-the-description-of-postmaster.pid-fie.patch (application/octet-stream, 1.8K) download From 28e6683d67a47bc602602eb7748751a5decd26a9 Mon Sep 17 00:00:00 2001 From: Fujii Masao <fujii@postgresql.org> Date: Mon, 2 Nov 2026 08:54:39 +0900 Subject: [PATCH v1] doc: Clarify the description of postmaster.pid fields Document the postmaster status and note that the shared memory field is empty on Windows. Also mention the shared memory segment ID in the pidfile.h comment. Author: Fujii Masao <masao.fujii@gmail.com> --- doc/src/sgml/storage.sgml | 4 +++- src/include/utils/pidfile.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index 5612e9868a6..58f997d5da0 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -174,7 +174,9 @@ last started with</entry> Unix-domain socket directory path (could be empty), first valid listen_address (IP address or <literal>*</literal>, or empty if not listening on TCP), - and shared memory segment key and ID + shared memory segment key and ID (empty on Windows), + and postmaster status (<literal>starting</literal>, <literal>ready</literal>, + <literal>standby</literal>, or <literal>stopping</literal>) (this file is not present after server shutdown)</entry> </row> diff --git a/src/include/utils/pidfile.h b/src/include/utils/pidfile.h index 82b4c1990c9..825e51adb74 100644 --- a/src/include/utils/pidfile.h +++ b/src/include/utils/pidfile.h @@ -23,7 +23,7 @@ * 4 port number * 5 first Unix socket directory path (empty if none) * 6 first listen_address (IP address or "*"; empty if no TCP port) - * 7 shared memory key (empty on Windows) + * 7 shared memory key and ID (empty on Windows) * 8 postmaster status (see values below) * * Lines 6 and up are added via AddToDataDirLockFile() after initial file -- 2.56.0
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
  2026-11-01 12:44     ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
  2026-11-01 19:16       ` Re: postmaster.pid also contains shared memory key Daniel Gustafsson <daniel@yesql.se>
  2026-11-02 00:21         ` Re: postmaster.pid also contains shared memory key Fujii Masao <masao.fujii@gmail.com>
@ 2026-11-02 05:05           ` Laurenz Albe <laurenz.albe@cybertec.at>
  2026-11-02 17:00             ` Re: postmaster.pid also contains shared memory key Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Laurenz Albe @ 2026-11-02 05:05 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; Daniel Gustafsson <daniel@yesql.se>; +Cc: Yong Huang <yong321@yahoo.com>; pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

On Mon, 2026-11-02 at 09:21 +0900, Fujii Masao wrote:
> On Mon, Nov 2, 2026 at 4:16 AM Daniel Gustafsson <daniel@yesql.se> wrote:
> > Pushed, thanks.
> 
> Thanks for working on this!
> 
> I think it's better to also clarify the postmaster status and note that
> the shared memory field is empty on Windows. Attached is a follow-up
> patch documenting both and adding the segment ID to the pidfile.h comment.
> Thought?

I think that your patch is a clear improvement.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: postmaster.pid also contains shared memory key
  2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
  2026-10-31 00:21 ` Re: postmaster.pid also contains shared memory key Michael Paquier <michael@paquier.xyz>
  2026-11-01 01:56   ` Re: postmaster.pid also contains shared memory key Yong Huang <yong321@yahoo.com>
  2026-11-01 12:44     ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
  2026-11-01 19:16       ` Re: postmaster.pid also contains shared memory key Daniel Gustafsson <daniel@yesql.se>
  2026-11-02 00:21         ` Re: postmaster.pid also contains shared memory key Fujii Masao <masao.fujii@gmail.com>
  2026-11-02 05:05           ` Re: postmaster.pid also contains shared memory key Laurenz Albe <laurenz.albe@cybertec.at>
@ 2026-11-02 17:00             ` Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Fujii Masao @ 2026-11-02 17:00 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Yong Huang <yong321@yahoo.com>; pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>

On Mon, Nov 2, 2026 at 2:05 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> I think that your patch is a clear improvement.

Thanks for the review! I've pushed the patch.

Regards,

-- 
Fujii Masao






^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2026-11-02 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 20:56 postmaster.pid also contains shared memory key PG Doc comments form <noreply@postgresql.org>
2026-10-31 00:21 ` Michael Paquier <michael@paquier.xyz>
2026-11-01 01:56   ` Yong Huang <yong321@yahoo.com>
2026-11-01 12:44     ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-11-01 19:16       ` Daniel Gustafsson <daniel@yesql.se>
2026-11-02 00:21         ` Fujii Masao <masao.fujii@gmail.com>
2026-11-02 05:05           ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-11-02 17:00             ` Fujii Masao <masao.fujii@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox