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

Method IsAmbiguous

postgres/parser/types/types.go:2309–2331  ·  view source on GitHub ↗

IsAmbiguous returns true if this type is in UnknownFamily or AnyFamily. Instances of ambiguous types can be NULL or be in one of several different type families. This is important for parameterized types to determine whether they are fully concrete or not.

()

Source from the content-addressed store, hash-verified

2307// type families. This is important for parameterized types to determine whether
2308// they are fully concrete or not.
2309func (t *T) IsAmbiguous() bool {
2310 switch t.Family() {
2311 case UnknownFamily, AnyFamily:
2312 return true
2313 case CollatedStringFamily:
2314 return t.Locale() == ""
2315 case TupleFamily:
2316 if len(t.TupleContents()) == 0 {
2317 return true
2318 }
2319 for i := range t.TupleContents() {
2320 if t.TupleContents()[i].IsAmbiguous() {
2321 return true
2322 }
2323 }
2324 return false
2325 case ArrayFamily:
2326 return t.ArrayContents().IsAmbiguous()
2327 case EnumFamily:
2328 return t.Oid() == oid.T_anyenum
2329 }
2330 return false
2331}
2332
2333// IsNumeric returns true iff this type is an integer, float, or decimal.
2334func (t *T) IsNumeric() bool {

Callers 3

typeCheckConstantFunction · 0.80
TypeCheckMethod · 0.80

Calls 5

FamilyMethod · 0.95
LocaleMethod · 0.95
TupleContentsMethod · 0.95
ArrayContentsMethod · 0.95
OidMethod · 0.95

Tested by

no test coverage detected