addning upsert on id for postgresql