pgsql: Fix handling of partitioned index in RelationGetNumberOfBlocksIn

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix handling of partitioned index in RelationGetNumberOfBlocksIn
Date: 2021-08-26 07:00:32
Message-ID: E1mJ9NI-000791-H2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)paquier(dot)xyz>
Reviewed-by: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Discussion: https://www.postgresql.org/message-id/1d3a5fbe-f48b-8bea-80da-9a5c4244aef9@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0d906b2c0b1f0d625ff63d9ace906556b1c66a68

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2021-08-26 08:40:00 Re: Separate out FileSet from SharedFileSet (was Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o)
Previous Message Peter Eisentraut 2021-08-26 06:39:31 Re: pgsql: psql: Add test for query canceling