redid skeleton for postgres use instead of sqlite3