diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/analyze.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index a70c7603416..b91df986c54 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -1360,11 +1360,14 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, else { /* - * ignore, but release the lock on it. could be a partitioned - * table. + * ignore, but release the lock on it. don't try to unlock the + * passed-in relation */ + Assert(childrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE); if (childrel != onerel) heap_close(childrel, AccessShareLock); + else + heap_close(childrel, NoLock); continue; } |