change lock to work with Postgres