Re: Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute. - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute.
Date
Msg-id 9315eecd-2a5e-4f4a-ac0a-c1faecde77ca@vondra.me
Whole thread Raw
In response to Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute.  (Ayush Tiwari <ayushtiwari.slg01@gmail.com>)
Responses Re: Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute.
List pgsql-hackers
On 8/19/24 11:01, Yugo Nagata wrote:
> On Mon, 19 Aug 2024 00:35:39 +0200
> Tomas Vondra <tomas@vondra.me> wrote:
> 
>> On 8/16/24 13:26, Tomas Vondra wrote:
>>> Hi Ayush,
>>>
>>> ...
>>>
>>> So this fix seems reasonable.
>>>
>>
>> I've pushed this to all affected branches, except for 11 which is EOL.
>>
>> I thought about adding a test, but I couldn't think of a TAP test where
>> this would really fit, and it didn't seem very practical to have a test
>> creating hundreds of roles. So I abandoned the idea.
> 
> I tried to add Assert in heap_inplace_update to prevent possible similar 
> failures, but I gave up because I could not find a good way to determine if
> a tuple is detoasted of not.
> 

Right, not sure there's a good way to check for that.

> By the way, I found a comment in vac_update_datfrozenxid() and EventTriggerOnLogin()
> that explains why we  could not use tuples from the syscache for heap_inplace_update. 
> I think it is better ad d the same comment in dropdb(). I attached a trivial patch for it.
> 

Agreed. That seems like a nice improvement to the comment.


regards

-- 
Tomas Vondra



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: thread-safety: gmtime_r(), localtime_r()
Next
From: Ashutosh Bapat
Date:
Subject: Re: define PG_REPLSLOT_DIR