Changed to postgres from sqlite3