Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0d906b2

Browse files
committed
Fix handling of partitioned index in RelationGetNumberOfBlocksInFork()
Since a partitioned index doesn't have storage, getting the number of blocks from it will not give sensible results. Existing callers already check that they don't call it that way, so there doesn't appear to be a live problem. But for correctness, handle RELKIND_PARTITIONED_INDEX together with the other non-storage relkinds. Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://www.postgresql.org/message-id/1d3a5fbe-f48b-8bea-80da-9a5c4244aef9@enterprisedb.com
1 parent 78ab944 commit 0d906b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/buffer/bufmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,6 @@ RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
29292929
{
29302930
case RELKIND_SEQUENCE:
29312931
case RELKIND_INDEX:
2932-
case RELKIND_PARTITIONED_INDEX:
29332932
return smgrnblocks(RelationGetSmgr(relation), forkNum);
29342933

29352934
case RELKIND_RELATION:
@@ -2951,6 +2950,7 @@ RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
29512950
case RELKIND_VIEW:
29522951
case RELKIND_COMPOSITE_TYPE:
29532952
case RELKIND_FOREIGN_TABLE:
2953+
case RELKIND_PARTITIONED_INDEX:
29542954
case RELKIND_PARTITIONED_TABLE:
29552955
default:
29562956
Assert(false);

0 commit comments

Comments
 (0)