Re: Failed Assert while pgstat_unlink_relation - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Failed Assert while pgstat_unlink_relation
Date
Msg-id 20221205174119.mtz52xkrbhpo7xqi@awork3.anarazel.de
Whole thread Raw
In response to Re: Failed Assert while pgstat_unlink_relation  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
Hi,

On 2022-12-05 15:20:55 +0900, Kyotaro Horiguchi wrote:
> The in-xact created relation t1 happened to be scanned during the
> CREATE RULE and a stats entry is attached. So the stats entry loses t1
> at roll-back, then crashes.  Thus, if I understand it correctly, it
> seems to me that just unlinking the stats from t1 (when relkind is
> changed) works.
> 
> But the fix doesn't change the behavior in relkind-not-changing
> cases. If an in-xact-created table gets a stats entry then the
> relcache entry for t1 is refreshed to a table relation again then the
> transaction rolls back, crash will happen for the same reason. I'm not
> sure if there is such a case actually.

We unlink the stats in that case already. see RelationDestroyRelation().


> When I tried to check that behavior further, I found that that
> CREATE ROLE is no longer allowed..

I assume you mean RULE, not ROLE? It should still work in 15.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Jonathan Lemig
Date:
Subject: Request to modify view_table_usage to include materialized views
Next
From: Jeff Davis
Date:
Subject: Re: Collation version tracking for macOS