1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Track detached partitions more accurately in partdescs

In d6b8d29419 I (Álvaro) was sloppy about recording whether a
partition descripor does or does not include detached partitions, when
the snapshot checking does not see the pg_inherits row marked detached.
In that case no partition was omitted, yet in the relcache entry we were
saving the partdesc as omitting partitions.  Flip that (so we save it as
a partdesc not omitting partitions, which indeed it doesn't), which
hopefully makes the code easier to reason about.

Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/CA+HiwqE7GxGU4VdzwZzfiz+Ont5SsopoFkgtrZGEdPqWRL+biA@mail.gmail.com
This commit is contained in:
Alvaro Herrera
2021-05-06 12:47:30 -04:00
parent c38cadc090
commit 3fe773b149
2 changed files with 17 additions and 9 deletions

View File

@@ -138,9 +138,7 @@ typedef struct RelationData
* rd_partdesc_nodetached. This informs a future user of that partdesc:
* if this value is not in progress for the active snapshot, then the
* partdesc can be used, otherwise they have to build a new one. (This
* matches what find_inheritance_children_extended would do). In the rare
* case where the pg_inherits tuple has been frozen, this will be
* InvalidXid; behave as if the partdesc is unusable in that case.
* matches what find_inheritance_children_extended would do).
*/
TransactionId rd_partdesc_nodetached_xmin;