MCPcopy Create free account
hub / github.com/apache/cloudberry / typenameType

Function typenameType

src/backend/parser/parse_type.c:265–284  ·  view source on GitHub ↗

* typenameType - given a TypeName, return a Type structure and typmod * * This is equivalent to LookupTypeName, except that this will report * a suitable error message if the type cannot be found or is not defined. * Callers of this can therefore assume the result is a fully valid type. */

Source from the content-addressed store, hash-verified

263 * Callers of this can therefore assume the result is a fully valid type.
264 */
265Type
266typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
267{
268 Type tup;
269
270 tup = LookupTypeName(pstate, typeName, typmod_p, false);
271 if (tup == NULL)
272 ereport(ERROR,
273 (errcode(ERRCODE_UNDEFINED_OBJECT),
274 errmsg("type \"%s\" does not exist",
275 TypeNameToString(typeName)),
276 parser_errposition(pstate, typeName->location)));
277 if (!((Form_pg_type) GETSTRUCT(tup))->typisdefined)
278 ereport(ERROR,
279 (errcode(ERRCODE_UNDEFINED_OBJECT),
280 errmsg("type \"%s\" is only a shell",
281 TypeNameToString(typeName)),
282 parser_errposition(pstate, typeName->location)));
283 return tup;
284}
285
286/*
287 * typenameTypeId - given a TypeName, return the type's OID

Callers 11

DefineTypeFunction · 0.85
DefineDomainFunction · 0.85
AlterTypeFunction · 0.85
ATExecAddColumnFunction · 0.85
ATExecAlterColumnTypeFunction · 0.85
ATExecAddOfFunction · 0.85
transformOfTypeFunction · 0.85
transformColumnTypeFunction · 0.85
typenameTypeIdFunction · 0.85
typenameTypeIdAndModFunction · 0.85

Calls 5

LookupTypeNameFunction · 0.85
TypeNameToStringFunction · 0.85
parser_errpositionFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected