Changed sqlite3 to postgres