From f25c50fd8fcdfdd32548b9140456249eb54a5109 Mon Sep 17 00:00:00 2001 From: Etsuro Fujita Date: Sat, 26 Sep 2026 20:40:00 +0900 Subject: [PATCH] postgres_fdw: Improve comment in fetch_remote_statistics(). Mention that the relpages value fetched from a remote server is stored as-is, regardless of any difference between the remote and local block sizes. Follow-up to commit 6a8571568. Reported-by: Fujii Masao Reported-by: Osama Abdul Qader Author: Etsuro Fujita Discussion: https://postgr.es/m/CAPmGK14OBMkMEkanHdA9%2BJdrZLGzfNRcEVmb6K4DtDe_CTTTqw%40mail.gmail.com Backpatch-through: 19 --- contrib/postgres_fdw/postgres_fdw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 42a704344b8..2bcff4b26b4 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -5954,7 +5954,10 @@ fetch_remote_statistics(Relation relation, /* * If the remote table is partitioned, import relpages = 0, to match the - * sampling case. + * sampling path. Otherwise, import the relpages value as-is, regardless + * of any difference between the remote and local block sizes. Note that + * this is fine because it's only used for costing remote operations on + * the foreign table. */ if (relkind == RELKIND_PARTITIONED_TABLE) remstats->relpages = 0;