Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4131f75

Browse files
committed
Repair find_inheritance_children with no active snapshot
When working on a scan with only a catalog snapshot, we may not have anActiveSnapshot set. If we were to come across a detached partition,that would cause a crash. Fix by only ignoring detached partitions whenthere's an active snapshot.
1 parenta3027e1 commit4131f75

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/catalog/pg_inherits.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ find_inheritance_children(Oid parentrelId, bool include_detached,
106106
*
107107
* The reason for this check is that we want to avoid seeing the
108108
* partition as alive in RI queries during REPEATABLE READ or
109-
* SERIALIZABLE transactions.
109+
* SERIALIZABLE transactions. (If there's no active snapshot set,
110+
* that means we're not running a user query, so it's OK to always
111+
* include detached partitions in that case.)
110112
*/
111113
if (((Form_pg_inherits)GETSTRUCT(inheritsTuple))->inhdetachpending&&
112-
!include_detached)
114+
!include_detached&&
115+
ActiveSnapshotSet())
113116
{
114117
TransactionIdxmin;
115118
Snapshotsnap;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp