MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Precision

Method Precision

pkg/sql/types/types.go:928–936  ·  view source on GitHub ↗

Precision is the accuracy of the data type. DECIMAL : max # digits (must be >= Width/Scale) INTERVAL : max # fractional second digits TIME : max # fractional second digits TIMETZ : max # fractional second digits TIMESTAMP : max # fractional second digits TIMESTAMPTZ: max # fractiona

()

Source from the content-addressed store, hash-verified

926//
927// Precision is always 0 for other types.
928func (t *T) Precision() int32 {
929 switch t.InternalType.Family {
930 case IntervalFamily, TimestampFamily, TimestampTZFamily, TimeFamily, TimeTZFamily:
931 if t.InternalType.Precision == 0 && !t.InternalType.TimePrecisionIsSet {
932 return defaultTimePrecision
933 }
934 }
935 return t.InternalType.Precision
936}
937
938// TypeModifier returns the type modifier of the type. This corresponds to the
939// pg_attribute.atttypmod column. atttypmod records type-specific data supplied

Callers 9

TypeModifierMethod · 0.95
SQLStringMethod · 0.95
upgradeTypeMethod · 0.95
StringMethod · 0.95
ParseMethod · 0.80
docMethod · 0.80
ParseAndRequireStringFunction · 0.80
FormatMethod · 0.80
PerformCastFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected