Postgresql Transaction Lock