Changed sqlite3 to postgresql