Lock a table with the LOCK TABLE statement

A transaction tells the database server to use table-level locking for a table with the LOCK TABLE statement. The following example shows how to place an exclusive lock on a table:
LOCK TABLE tab1 IN EXCLUSIVE MODE
The following example shows how to place a shared lock on a table:
LOCK TABLE tab2 IN SHARE MODE
Tip: You can set the isolation level for your database server to achieve the same degree of protection as the shared table lock while providing greater concurrency.