pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid failure to open dropped detached partition
Date: Mon, 19 Aug 2024 20:12:20 +0000
Message-ID: <E1sg8jk-000SzB-2O@gemulon.postgresql.org> (raw)

Avoid failure to open dropped detached partition

When a partition is detached and immediately dropped, a prepared
statement could try to compute a new partition descriptor that includes
it.  This leads to this kind of error:
ERROR:  could not open relation with OID 457639

Avoid this by skipping the partition in expand_partitioned_rtentry if it
doesn't exist.

Noted by me while investigating bug #18559.  Kuntal Gosh helped to
identify the exact failure.

Backpatch to 14, where DETACH CONCURRENTLY was introduced.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/202408122233.bo4adt3vh5bi@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/52f3de874bbeaf16b3ae2efb505c1117be8355cc

Modified Files
--------------
src/backend/optimizer/util/inherit.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)



view thread (5+ messages)

Message-ID: <E1sg8jk-000SzB-2O@gemulon.postgresql.org>
Permalink:  ../E1sg8jk-000SzB-2O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sg8jk-000SzB-2O@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: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid failure to open dropped detached partition
  In-Reply-To: <E1sg8jk-000SzB-2O@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