Assert no duplicate keys in shm_toc_insert()

Melanie Plageman <melanieplageman@gmail.com>

Commit: 43222b8e53f49f2cf0849947a02c6fbd74899332
Author: Melanie Plageman <melanieplageman@gmail.com>
Date: 2026-04-06T22:41:47Z
Assert no duplicate keys in shm_toc_insert()

shm_toc_insert() silently accepts duplicate keys. Since shm_toc_lookup()
returns the first matching entry, any later entry with the same key
would be unreachable. Add an assertion to catch this.

Author: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/flat/a177a6dd-240b-455a-8f25-aca0b1c08c6e%40vondra.me

Files

PathChange+/−
src/backend/storage/ipc/shm_toc.c modified +7 −0

Discussion

Cited messages not in the archive: flat/a177a6dd-240b-455a-8f25-aca0b1c08c6e@vondra.me