Re: How to explicitly lock and unlock tables in pgsql?

2022-03-18 Thread Merlin Moncure
On Thu, Mar 17, 2022 at 2:52 AM Laurenz Albe wrote: > > On Wed, 2022-03-16 at 20:30 +, Shaozhong SHI wrote: > > Table locks present a barrier for progressing queries. > > > > How to explicitly lock and unlock tables in pgsql, so that we can guarantee > > the progress of running scripts? > > Y

Re: How to explicitly lock and unlock tables in pgsql?

2022-03-18 Thread Laurenz Albe
On Fri, 2022-03-18 at 11:38 -0500, Merlin Moncure wrote: > > Also, you should nevr explicitly lock tables.  Table locks are taken > > automatically > > by the SQL statements you are executing. > > Isn't that a bit of overstatement? > LOCK table foo; > > Locks the table, with the benefit you can