Added safe apply to ValidityRange; broke Pg conversions into encode/decode