MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Precision

Method Precision

postgres/parser/types/types.go:1149–1157  ·  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 # fra

()

Source from the content-addressed store, hash-verified

1147//
1148// Precision is always 0 for other types.
1149func (t *T) Precision() int32 {
1150 switch t.InternalType.Family {
1151 case IntervalFamily, TimestampFamily, TimestampTZFamily, TimeFamily, TimeTZFamily:
1152 if t.InternalType.Precision == 0 && !t.InternalType.TimePrecisionIsSet {
1153 return defaultTimePrecision
1154 }
1155 }
1156 return t.InternalType.Precision
1157}
1158
1159// TypeModifier returns the type modifier of the type. This corresponds to the
1160// pg_attribute.atttypmod column. atttypmod records type-specific data supplied

Callers 8

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

Calls

no outgoing calls

Tested by

no test coverage detected