pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Assert that ExecOpenIndices and ExecCloseIndices are not repeate
Date: Wed, 19 Feb 2025 21:45:20 +0000
Message-ID: <E1tkrsf-000CXf-0x@gemulon.postgresql.org> (raw)

Assert that ExecOpenIndices and ExecCloseIndices are not repeated.

These functions should be called at most once per ResultRelInfo;
it's wasteful to do otherwise, and certainly the pattern of
opening twice and then closing twice is a bad idea.  Moreover,
aminsertcleanup functions might not be prepared to be called twice,
as the just-hardened code in BRIN demonstrates.

This amounts to an API change, since such coding patterns were
safe even if wasteful before v17.  Hence, apply to HEAD only.
(Extension code violating this new rule faces some risk in v17,
but we just fixed brininsertcleanup and there are probably few
other aminsertcleanup functions as yet.  So the odds of breaking
usable code seem higher than the odds of doing something useful
with a back-patch.)

Bug: #18815
Reported-by: Sergey Belyashov <sergey.belyashov@gmail.com>
Discussion: https://postgr.es/m/18815-2a0407cc7f40b327@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e596e077bbb3b512bbc80610d64dc007a5761ce6

Modified Files
--------------
src/backend/executor/execIndexing.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)



Message-ID: <E1tkrsf-000CXf-0x@gemulon.postgresql.org>
Permalink:  ../E1tkrsf-000CXf-0x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tkrsf-000CXf-0x@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Assert that ExecOpenIndices and ExecCloseIndices are not repeate
  In-Reply-To: <E1tkrsf-000CXf-0x@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox