postgresql/src/backend
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
..
access Revert "Allow parallel workers to cope with a newly-created session user ID." 2024-07-31 20:55:51 -04:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Reset relhassubclass upon attaching table as a partition 2024-07-24 12:38:18 +02:00
commands Explain dropdb can't use syscache because of TOAST 2024-08-19 13:47:07 +02:00
executor Fix edge case in plpgsql's make_callstmt_target(). 2024-08-07 12:54:39 -04:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:23 -07:00
jit Fix illegal attribute propagation in LLVM JIT. 2024-04-10 12:15:07 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 15:47:12 +12:00
libpq Fix regression in TLS session ticket disabling 2024-08-19 12:55:11 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:38 +09:00
nodes Remove inappropriate raw_expression_tree_walker() code 2023-06-29 10:35:53 +02:00
optimizer Avoid failure to open dropped detached partition 2024-08-19 16:09:10 -04:00
parser Avoid unhelpful internal error for incorrect recursive-WITH queries. 2024-07-14 13:49:46 -04:00
partitioning Fix creation of partition descriptor during concurrent detach+drop 2024-08-12 18:17:56 -04:00
po Translation updates 2024-08-05 12:22:08 +02:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Fix bugs in MultiXact truncation 2024-06-26 23:06:12 +03:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:20:32 -07:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:13 +09:00
rewrite Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:23 -07:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:18:42 +13:00
storage Fix lost Windows socket EOF events. 2024-07-13 15:43:43 +12:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:23 -07:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Fix harmless LC_COLLATE[_MASK] confusion. 2024-08-19 22:22:20 +12:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-09-20 16:23:13 +02:00