newDecimal creates a type for DECIMAL with the given precision and scale.
(prec, scale int32)
| 485 | |
| 486 | // newDecimal creates a type for DECIMAL with the given precision and scale. |
| 487 | func newDecimal(prec, scale int32) (*types.T, error) { |
| 488 | if scale > prec { |
| 489 | err := pgerror.WithCandidateCode( |
| 490 | errors.Newf("scale (%d) must be between 0 and precision (%d)", scale, prec), |
| 491 | pgcode.InvalidParameterValue) |
| 492 | return nil, err |
| 493 | } |
| 494 | return types.MakeDecimal(prec, scale), nil |
| 495 | } |
| 496 | |
| 497 | // arrayOf creates a type alias for an array of the given element type and fixed |
| 498 | // bounds. The bounds are currently ignored. |
nothing calls this directly
no test coverage detected
searching dependent graphs…