replace sqlite3 with PostgreSQL