changed to postgres from sqlite3