Re: BUG #18866: Running pg_freespace() on views triggers an Abort - Mailing list pgsql-bugs

From Tender Wang
Subject Re: BUG #18866: Running pg_freespace() on views triggers an Abort
Date
Msg-id CAHewXNk6uX0VBROmoMrnKs_AOzbAQo+i9pouUiYj01y50HZRSw@mail.gmail.com
Whole thread Raw
In response to BUG #18866: Running pg_freespace() on views triggers an Abort  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18866: Running pg_freespace() on views triggers an Abort
List pgsql-bugs


PG Bug reporting form <noreply@postgresql.org> 于2025年3月25日周二 22:42写道:
The following bug has been logged on the website:

Bug reference:      18866
Logged by:          Robins Tharakan
Email address:      tharakan@gmail.com
PostgreSQL version: Unsupported/Unknown
Operating system:   Ubuntu
Description:       

Hi,

Passing a view to pg_freespace() triggers an Abort on HEAD. This has been so
since the beginning (049ef3398d05c9dc8f48aa9a6d68440661cfeb87). Given that
this is just an assert, feel free to skip - but thought I'd bring it up, in
case this needs a review.

SQL / Backtrace / Error Log excerpt given below:


SQL
===
$ cat crashing.sql
CREATE EXTENSION pg_freespacemap;
SELECT pg_freespace('pg_roles', 0);

Yeah, it would crash if you input a foreign table, for example:
create extension postgres_fdw;
CREATE SERVER d FOREIGN DATA WRAPPER postgres_fdw;
CREATE FOREIGN TABLE f (g text) SERVER d; 
SELECT pg_freespace('f', 0);    -- will crash too

I think we can remove the Assert in smgropen().
Any thoughts?

--
Thanks,
Tender Wang
Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18866: Running pg_freespace() on views triggers an Abort
Next
From: Tom Lane
Date:
Subject: Re: BUG #18866: Running pg_freespace() on views triggers an Abort