[Database] Added support for lock/unlock in Postgres.