Changing sqlite3 to postgresql