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

Function getTypeOutputInfo

src/backend/utils/cache/lsyscache.c:3507–3533  ·  view source on GitHub ↗

* getTypeOutputInfo * * Get info needed for printing values of a type */

Source from the content-addressed store, hash-verified

3505 * Get info needed for printing values of a type
3506 */
3507void
3508getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
3509{
3510 HeapTuple typeTuple;
3511 Form_pg_type pt;
3512
3513 typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
3514 if (!HeapTupleIsValid(typeTuple))
3515 elog(ERROR, "cache lookup failed for type %u", type);
3516 pt = (Form_pg_type) GETSTRUCT(typeTuple);
3517
3518 if (!pt->typisdefined)
3519 ereport(ERROR,
3520 (errcode(ERRCODE_UNDEFINED_OBJECT),
3521 errmsg("type %s is only a shell",
3522 format_type_be(type))));
3523 if (!OidIsValid(pt->typoutput))
3524 ereport(ERROR,
3525 (errcode(ERRCODE_UNDEFINED_FUNCTION),
3526 errmsg("no output function available for type %s",
3527 format_type_be(type))));
3528
3529 *typOutput = pt->typoutput;
3530 *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
3531
3532 ReleaseSysCache(typeTuple);
3533}
3534
3535/*
3536 * getTypeBinaryInputInfo

Callers 15

deparseConstFunction · 0.85
create_foreign_modifyFunction · 0.85
prepare_query_paramsFunction · 0.85
brin_page_itemsFunction · 0.85
hstore_from_recordFunction · 0.85
set_limitFunction · 0.85
tuple_to_stringinfoFunction · 0.85
pltcl_set_tuple_valuesFunction · 0.85
convert_value_to_stringFunction · 0.85
plperl_sv_to_literalFunction · 0.85
plperl_hash_from_tupleFunction · 0.85

Calls 6

SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
format_type_beFunction · 0.85
ReleaseSysCacheFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by 1

tuple_to_stringinfoFunction · 0.68