Prevent assertion failure in contrib/pg_freespacemap.
authorTom Lane <[email protected]>
Thu, 27 Mar 2025 17:20:23 +0000 (13:20 -0400)
committerTom Lane <[email protected]>
Thu, 27 Mar 2025 17:20:23 +0000 (13:20 -0400)
commit5ff827389e7739c05888218bd9cd123f0b9b3122
treee6430a87170d51a0da060833f7a950c3c906b819
parentb209856b6224ae9516e49690eb49101b4309846a
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 protected]>
Author: Tender Wang <[email protected]>
Reviewed-by: Euler Taveira <[email protected]>
Discussion: https://postgr.es/m/18866-d68926d0f1c72d44@postgresql.org
Backpatch-through: 13
contrib/pg_freespacemap/pg_freespacemap.c