Change locking scheme in pg>9.1