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 t

Re: table_open/table_close with different lock mode

2023-07-20 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, l

Re: table_open/table_close with different lock mode

2023-07-20 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-20 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 is