changed sqlite3 usage, added pg