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

Method PGName

pkg/sql/types/types.go:1093–1105  ·  view source on GitHub ↗

PGName returns the Postgres name for the type. This is sometimes different than the native CRDB name for it (i.e. the Name function). It is used when compatibility with PG is important. Examples of differences: Name() PGName() -------------------------- char bpchar "char" char b

()

Source from the content-addressed store, hash-verified

1091// int4[] _int4
1092//
1093func (t *T) PGName() string {
1094 name, ok := oid.TypeName[t.Oid()]
1095 if ok {
1096 return strings.ToLower(name)
1097 }
1098
1099 // Postgres does not have an UNKNOWN[] type. However, CRDB does, so
1100 // manufacture a name for it.
1101 if t.Family() != ArrayFamily || t.ArrayContents().Family() != UnknownFamily {
1102 panic(errors.AssertionFailedf("unknown PG name for oid %d", t.Oid()))
1103 }
1104 return "_unknown"
1105}
1106
1107// SQLStandardName returns the type's name as it is specified in the SQL
1108// standard (or by Postgres for any non-standard types). This can be looked up

Callers 2

computeCastNameFunction · 0.80
PerformCastFunction · 0.80

Calls 3

OidMethod · 0.95
FamilyMethod · 0.95
ArrayContentsMethod · 0.95

Tested by

no test coverage detected