Changes for postgresql migration