More updates to switch from mysql2 to postgresql