Re: Crash in record_type_typmod_compare - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Crash in record_type_typmod_compare
Date
Msg-id 3229167.1617210650@sss.pgh.pa.us
Whole thread Raw
In response to Re: Crash in record_type_typmod_compare  (Sait Talha Nisanci <Sait.Nisanci@microsoft.com>)
Responses Re: Crash in record_type_typmod_compare  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Sait Talha Nisanci <Sait.Nisanci@microsoft.com> writes:
>> We should probably do
HASH_ENTER<https://github.com/postgres/postgres/blob/1509c6fc29c07d13c9a590fbd6f37c7576f58ba6/src/backend/utils/cache/typcache.c#L1974>
onlyafter we have a valid entry so that we don't end up with a NULL entry in the cache even if an intermediate error
happens.I will share a fix in this thread soon. 
> I am attaching this patch.

I see the hazard, but this seems like an expensive way to fix it,
as it forces two hash searches for every insertion.  Couldn't we just
teach record_type_typmod_compare to say "not equal" if it sees a
null tupdesc?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: making update/delete of inheritance trees scale better
Next
From: Robert Haas
Date:
Subject: Re: pg_amcheck contrib application