support setting pg instance