postgresql/src/backend/optimizer/util
Alvaro Herrera 3ad4c8615a
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
2024-08-19 16:09:10 -04:00
..
appendinfo.c Rework planning and execution of UPDATE and DELETE. 2021-03-31 11:52:37 -04:00
clauses.c Fix type-checking of RECORD-returning functions in FROM, redux. 2024-04-15 12:56:56 -04:00
inherit.c Avoid failure to open dropped detached partition 2024-08-19 16:09:10 -04:00
joininfo.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
orclauses.c Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar. 2021-01-21 15:37:23 -05:00
paramassign.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pathnode.c Fix possible Assert failure in cost_memoize_rescan 2024-06-19 10:21:52 +12:00
placeholder.c Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar. 2021-01-21 15:37:23 -05:00
plancat.c Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:23 -07:00
predtest.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
relnode.c Fix generation of EC join conditions at the wrong plan level. 2024-04-16 11:22:39 -04:00
restrictinfo.c Disallow replacing joins with scans in problematic cases. 2023-07-28 15:45:04 +09:00
tlist.c Fix typos in comments, code and documentation 2023-01-03 16:26:30 +09:00
var.c Suppress more variable-set-but-not-used warnings from clang 15. 2022-09-21 13:52:38 -04:00