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

Method IsAmbiguous

pkg/sql/types/types.go:1927–1947  ·  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

1925// type families. This is important for parameterized types to determine whether
1926// they are fully concrete or not.
1927func (t *T) IsAmbiguous() bool {
1928 switch t.Family() {
1929 case UnknownFamily, AnyFamily:
1930 return true
1931 case CollatedStringFamily:
1932 return t.Locale() == ""
1933 case TupleFamily:
1934 if len(t.TupleContents()) == 0 {
1935 return true
1936 }
1937 for i := range t.TupleContents() {
1938 if t.TupleContents()[i].IsAmbiguous() {
1939 return true
1940 }
1941 }
1942 return false
1943 case ArrayFamily:
1944 return t.ArrayContents().IsAmbiguous()
1945 }
1946 return false
1947}
1948
1949// IsStringType returns true iff the given type is String or a collated string
1950// type.

Callers 4

typeCheckConstantFunction · 0.80
TypeCheckMethod · 0.80
checkReturnFunction · 0.80

Calls 4

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

Tested by

no test coverage detected