Re: Forbid to DROP temp tables of other sessions - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: Forbid to DROP temp tables of other sessions
Date
Msg-id 9A1C6763-A293-4EDD-A462-EFCF93BA2909@yandex-team.ru
Whole thread Raw
In response to Forbid to DROP temp tables of other sessions  (Daniil Davydov <3danissimo@gmail.com>)
Responses Re: Forbid to DROP temp tables of other sessions
List pgsql-hackers

> On 14 Nov 2024, at 11:55, Daniil Davydov <3danissimo@gmail.com> wrote:
>
> On Wed, Oct 30, 2024 at 7:32 PM Rafia Sabih <rafia.pghackers@gmail.com> wrote:
>
>> Good catch. I agree with this being an unwarranted behaviour.
>> A minor comment from my end is the wording of the error message.
>> Based on the Postgresql error message style huide, something like this could be better,
>> "could not access temporary relations of other sessions".
>> --
>> Regards,
>> Rafia Sabih
>> CYBERTEC PostgreSQL International GmbH
>>
> Thanks for your comment. I attach a patch with a fixed error message.
> Also you can find it in commit fest
> (https://commitfest.postgresql.org/51/5379/)

I suspect that protection of temp tables was broken by 00d1e02be249. And I'd suggest fixing it in a line with how it
workedbefore. Changes to locking mechanism is kind of a super subtle matters, it is really hard to bring this checks
herewithout breaking something else. Maybe not immidiately. but still. I'd suggest fixing somewhere around
RelationAddBlocks().But be sure to check all code pathes that lead to this check. 

Also, having an isolation test is nice. But do we actually do isolation tests with PL\pgSQL?

Thanks!


Best regards, Andrey Borodin.




pgsql-hackers by date:

Previous
From: Alexandra Wang
Date:
Subject: Re: SQL:2023 JSON simplified accessor support
Next
From: yuansong
Date:
Subject: Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST