agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Assert no duplicate keys in shm_toc_insert()
Date: Mon, 06 Apr 2026 22:42:53 +0000
Message-ID: <E1w9sei-003Iey-1T@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/43222b8e53f49f2cf0849947a02c6fbd74899332

Modified Files
--------------
src/backend/storage/ipc/shm_toc.c | 7 +++++++
1 file changed, 7 insertions(+)



Message-ID: <E1w9sei-003Iey-1T@gemulon.postgresql.org>
Permalink:  ../E1w9sei-003Iey-1T@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9sei-003Iey-1T@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Assert no duplicate keys in shm_toc_insert()
  In-Reply-To: <E1w9sei-003Iey-1T@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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