newDecimal creates a type for DECIMAL with the given precision and scale.
(prec, scale int32)
| 347 | |
| 348 | // newDecimal creates a type for DECIMAL with the given precision and scale. |
| 349 | func newDecimal(prec, scale int32) (*types.T, error) { |
| 350 | if scale > prec { |
| 351 | err := pgerror.WithCandidateCode( |
| 352 | errors.Newf("scale (%d) must be between 0 and precision (%d)", scale, prec), |
| 353 | pgcode.InvalidParameterValue) |
| 354 | return nil, err |
| 355 | } |
| 356 | return types.MakeDecimal(prec, scale), nil |
| 357 | } |
| 358 | |
| 359 | // ArrayOf creates a type alias for an array of the given element type and fixed |
| 360 | // bounds. |
no test coverage detected
searching dependent graphs…