Changing sqllite3 to postgresql