pgsql: Avoid failure to open dropped detached partition - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Avoid failure to open dropped detached partition
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
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 <[email protected]>
Reviewed-by: Kuntal Ghosh <[email protected]>
Reviewed-by: Junwang Zhao <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3ad4c8615a7616c0d3f6bf6fe9bdd22d43c95813

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


pgsql-committers by date:

Previous
From: Tomas Vondra
Date:
Subject: pgsql: Document that search_path is reported by the server
Next
From: Bruce Momjian
Date:
Subject: pgsql: doc: Improve vague pg_createsubscriber description