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
()
| 1091 | // int4[] _int4 |
| 1092 | // |
| 1093 | func (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 |
no test coverage detected