Re: table_open/table_close with different lock mode

2023-07-21 Thread Junwang Zhao
On Fri, Jul 21, 2023 at 2:57 PM Gurjeet Singh wrote: > > On Thu, Jul 20, 2023 at 11:38 PM Junwang Zhao wrote: > > > > On Fri, Jul 21, 2023 at 2:26 PM Michael Paquier wrote: > > > > > > On Fri, Jul 21, 2023 at 02:05:56PM +0800, Junwang Zhao wrote: > > > > I noticed there are some places calling

Re: table_open/table_close with different lock mode

2023-07-21 Thread Gurjeet Singh
On Thu, Jul 20, 2023 at 11:38 PM Junwang Zhao wrote: > > On Fri, Jul 21, 2023 at 2:26 PM Michael Paquier wrote: > > > > On Fri, Jul 21, 2023 at 02:05:56PM +0800, Junwang Zhao wrote: > > > I noticed there are some places calling table_open with > > > RowExclusiveLock but table_close with NoLock,

Re: table_open/table_close with different lock mode

2023-07-21 Thread Junwang Zhao
On Fri, Jul 21, 2023 at 2:26 PM Michael Paquier wrote: > > On Fri, Jul 21, 2023 at 02:05:56PM +0800, Junwang Zhao wrote: > > I noticed there are some places calling table_open with > > RowExclusiveLock but table_close with NoLock, like in function > > toast_save_datum. > > > > Can anybody explain

Re: table_open/table_close with different lock mode

2023-07-21 Thread Michael Paquier
On Fri, Jul 21, 2023 at 02:05:56PM +0800, Junwang Zhao wrote: > I noticed there are some places calling table_open with > RowExclusiveLock but table_close with NoLock, like in function > toast_save_datum. > > Can anybody explain the underlying logic, thanks in advance. This rings a bell. This

table_open/table_close with different lock mode

2023-07-21 Thread Junwang Zhao
Hey hackers, I noticed there are some places calling table_open with RowExclusiveLock but table_close with NoLock, like in function toast_save_datum. Can anybody explain the underlying logic, thanks in advance. -- Regards Junwang Zhao