postgresql/src
Alvaro Herrera a6ff329e7b
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
..
backend Avoid failure to open dropped detached partition 2024-08-19 16:09:10 -04:00
bin Fix pg_rewind debug output to print the source timeline history 2024-08-08 10:22:49 +03:00
common Make fallback MD5 implementation thread-safe on big-endian systems 2024-08-07 10:44:05 +03:00
fe_utils Fix PL/pgSQL's handling of integer ranges containing underscores. 2024-06-04 11:51:25 +01:00
include Allow adjusting session_authorization and role in parallel workers. 2024-08-10 15:51:28 -04:00
interfaces Revert ECPG's use of pnstrdup() 2024-08-08 07:42:21 +02:00
makefiles Use --strip-unneeded when stripping static libraries with GNU strip. 2023-04-20 18:12:32 -04:00
pl Fix edge case in plpgsql's make_callstmt_target(). 2024-08-07 12:54:39 -04:00
port Fix gai_strerror() thread-safety on Windows. 2024-02-12 11:14:42 +13:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Allow adjusting session_authorization and role in parallel workers. 2024-08-10 15:51:28 -04:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools ci: Upgrade MacPorts version to 2.10.1. 2024-08-19 11:48:22 +12:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in Suppress macOS warnings about duplicate libraries in link commands. 2023-09-29 14:07:30 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00