Summary:
**Issue:**
Previously, only `ACCESS SHARE `mode is accepted, and other lock modes were blocked. For example:
```
yugabyte=*# LOCK TABLE test_table IN ACCESS EXCLUSIVE MODE;
ERROR: ACCESS EXCLUSIVE not supported yet
```
**Fix:**
The internal implementation of table-level lock was already in place. This change connects the final piece by enabling the parser at the PG layer, allowing `LOCK TABLE` statements to parse and invoke the YBCAcquireObjectLock(lock_id, mode) API for all the modes.
This was achieved by modifying `gram.y` to support parsing of table-level lock modes. With this update, the following lock modes are now accepted:
* SHARE
* ACCESS SHARE (Already supported before this change)
* SHARE ROW EXCLUSIVE
* EXCLUSIVE
* ACCESS EXCLUSIVE
* ROW SHARE
* ROW EXCLUSIVE
* SHARE UPDATE EXCLUSIVE
Additionally, `LOCK TABLE` commands (except for `ACCESS SHARE` mode) will now fail when table level lock gflag(`TEST_enable_object_locking_for_table_locks`) is disabled. The exception for `ACCESS SHARE` mode is necessary to maintain compatibility with pg_dump. See D6225 for further details.
Jira: DB-16205
Test Plan:
./yb_build.sh --cxx-test pgwrapper_pg_object_locks-test --gtest_filter PgObjectLocksTestRF1.VerifyTableLockBlockingBehavior
./yb_build.sh --cxx-test pgwrapper_pg_row_lock-test --gtest_filter PgRowLockTest.ObjectLocksNotSupported
Reviewers: bkolagani
Reviewed By: bkolagani
Subscribers: jason, pjain, yql, ybase, rthallam
Differential Revision: https://phorge.dev.yugabyte.com/D43229