replace sqlite3 by pg