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

Function getTypeBinaryOutputInfo

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

* getTypeBinaryOutputInfo * * Get info needed for binary output of values of a type */

Source from the content-addressed store, hash-verified

3571 * Get info needed for binary output of values of a type
3572 */
3573void
3574getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
3575{
3576 HeapTuple typeTuple;
3577 Form_pg_type pt;
3578
3579 typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type));
3580 if (!HeapTupleIsValid(typeTuple))
3581 elog(ERROR, "cache lookup failed for type %u", type);
3582 pt = (Form_pg_type) GETSTRUCT(typeTuple);
3583
3584 if (!pt->typisdefined)
3585 ereport(ERROR,
3586 (errcode(ERRCODE_UNDEFINED_OBJECT),
3587 errmsg("type %s is only a shell",
3588 format_type_be(type))));
3589 if (!OidIsValid(pt->typsend))
3590 ereport(ERROR,
3591 (errcode(ERRCODE_UNDEFINED_FUNCTION),
3592 errmsg("no binary output function available for type %s",
3593 format_type_be(type))));
3594
3595 *typSend = pt->typsend;
3596 *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
3597
3598 ReleaseSysCache(typeTuple);
3599}
3600
3601/*
3602 * get_typmodin

Callers 7

SendFunctionResultFunction · 0.85
array_agg_serializeFunction · 0.85
record_sendFunction · 0.85
BeginCopyToOnSegmentFunction · 0.85
CopyToFunction · 0.85
printtup_prepare_infoFunction · 0.85
InitParseStateToFunction · 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

no test coverage detected