Replace sqlite3 with postgres