postmaster.pid also contains shared memory key

Started by PG Bug reporting form6 days ago8 messagesdocs
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

This thread has been committed, so CI has stopped here. Anything below is the last result it produced.

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t254438
psql -h localhost -U postgres

Built from patchset v6 (message #6), November 02, 2026 at 12:34 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t254438_6 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t254438_6 && git checkout t254438_6

Patchset v6 (message #6) is on t254438_6

Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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?

#2Michael Paquier
michael@paquier.xyz
In reply to: PG Bug reporting form (#1)
Re: postmaster.pid also contains shared memory key

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

#3Yong Huang
yong321@yahoo.com
In reply to: Michael Paquier (#2)
Re: postmaster.pid also contains shared memory key

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

#4Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Yong Huang (#3)
Re: postmaster.pid also contains shared memory key

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:

t254438_4
v1-0001-Improve-documentation-for-postmaster.pid.patchtext/x-patch; charset=UTF-8; name=v1-0001-Improve-documentation-for-postmaster.pid.patchDownload+1-2
#5Daniel Gustafsson
daniel@yesql.se
In reply to: Laurenz Albe (#4)
Re: postmaster.pid also contains shared memory key

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

#6Fujii Masao
masao.fujii@gmail.com
In reply to: Daniel Gustafsson (#5)
Re: postmaster.pid also contains shared memory key

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:

t254438_6
v1-0001-doc-Clarify-the-description-of-postmaster.pid-fie.patchapplication/octet-stream; name=v1-0001-doc-Clarify-the-description-of-postmaster.pid-fie.patchDownload+4-3
#7Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Fujii Masao (#6)
Re: postmaster.pid also contains shared memory key

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

#8Fujii Masao
masao.fujii@gmail.com
In reply to: Laurenz Albe (#7)
Re: postmaster.pid also contains shared memory key

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