Subject: pgsql: Prevent assertion failure in contrib/pg_freespacemap.

From: Tom Lane <[email-masked]>
Date: Thu, 27 Mar 2025 17:20:38 +0000

Prevent assertion failure in contrib/pg_freespacemap.

Applying pg_freespacemap() to a relation lacking storage (such as a
view) caused an assertion failure, although there was no ill effect
in non-assert builds.  Add an error check for that case.

Bug: #18866
Reported-by: Robins Tharakan <[email-masked]>
Author: Tender Wang <[email-masked]>
Reviewed-by: Euler Taveira <[email-masked]>
Discussion: https://postgr.es/m/[email-masked]
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/51d038da8280a597ebb769a9a1bcf027d4d80132

Modified Files
--------------
contrib/pg_freespacemap/pg_freespacemap.c | 8 ++++++++
1 file changed, 8 insertions(+)