Re: Crash in record_type_typmod_compare
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Metin Doslu <Metin.Doslu@microsoft.com>
Date: 2021-03-31T17:10:50Z
Lists: 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> only after 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
Commits
-
Fix assign_record_type_typmod().
- 52c168db955d 11.13 landed
- 5b1621d2fb73 12.8 landed
- edd9a2bf741b 13.4 landed
- 10a07973cf72 14.0 landed
- dd0e37cc1598 15.0 landed
-
Improve an error message
- 1509c6fc29c0 14.0 cited