replace sqlite by pg