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

Change-Id: Ie422de58c36f195597eabdd51a27d3ed2c2880cf