typedefstruct ExpandedRecordHeader
{ /* Standard header for expanded objects */
ExpandedObjectHeader hdr;
/* Magic value identifying an expanded record (for debugging only) */ int er_magic;
/* Assorted flag bits */ int flags; #define ER_FLAG_FVALUE_VALID 0x0001 /* fvalue is up to date? */ #define ER_FLAG_FVALUE_ALLOCED 0x0002 /* fvalue is local storage? */ #define ER_FLAG_DVALUES_VALID 0x0004 /* dvalues/dnulls are up to date? */ #define ER_FLAG_DVALUES_ALLOCED 0x0008 /* any field values local storage? */ #define ER_FLAG_HAVE_EXTERNAL 0x0010 /* any field values are external? */ #define ER_FLAG_TUPDESC_ALLOCED 0x0020 /* tupdesc is local storage? */ #define ER_FLAG_IS_DOMAIN 0x0040 /* er_decltypeid is domain? */ #define ER_FLAG_IS_DUMMY 0x0080 /* this header is dummy (see below) */ /* flag bits that are not to be cleared when replacing tuple data: */ #define ER_FLAGS_NON_DATA \
(ER_FLAG_TUPDESC_ALLOCED | ER_FLAG_IS_DOMAIN | ER_FLAG_IS_DUMMY)
/* Declared type of the record variable (could be a domain type) */
Oid er_decltypeid;
/* *Actualcompositetype/typmod;neveradomain(ifER_FLAG_IS_DOMAIN, *theseidentifythecompositebasetype).Thesewillmatch *er_tupdesc->tdtypeid/tdtypmod,aswellastheheaderfieldsof *compositedatumsmadefromorstoredinthisexpandedrecord.
*/
Oid er_typeid; /* type OID of the composite type */
int32 er_typmod; /* typmod of the composite type */
Size data_len; /* data len within flat_size */ int hoff; /* header offset */ bool hasnull; /* null bitmap needed? */
/* *fvaluepointstotheflatrepresentationifwehaveone,elseitis *NULL.Iftheflatrepresentationisvalid(uptodate)then *ER_FLAG_FVALUE_VALIDisset.Evenifwe'veoutdatedtheflat *representationduetochangesofuserfields,itcanstillbeusedto *fetchsystemcolumnvalues.Ifwehaveaflatrepresentationthen *fstartptr/fendptrpointtothestartandend+1ofitsdataarea;this *issothatwecantellwhichDatumpointerspointintotheflat *representationratherthanbeingpointerstoseparatelypalloc'ddata.
*/
HeapTuple fvalue; /* might or might not be private storage */ char *fstartptr; /* start of its data area */ char *fendptr; /* end+1 of its data area */
/* Some operations on the expanded record need a short-lived context */
MemoryContext er_short_term_cxt; /* short-term memory context */
/* Working state for domain checking, used if ER_FLAG_IS_DOMAIN is set */ struct ExpandedRecordHeader *er_dummy_header; /* dummy record header */ void *er_domaininfo; /* cache space for domain_check() */
/* Callback info (it's active if er_mcb.arg is not NULL) */
MemoryContextCallback er_mcb;
} ExpandedRecordHeader;
/* fmgr functions and macros for expanded record objects */ staticinline Datum
ExpandedRecordGetDatum(const ExpandedRecordHeader *erh)
{ return EOHPGetRWDatum(&erh->hdr);
}
staticinline Datum
ExpandedRecordGetRODatum(const ExpandedRecordHeader *erh)
{ return EOHPGetRODatum(&erh->hdr);
}
/* this can substitute for TransferExpandedObject() when we already have erh */ #define TransferExpandedRecord(erh, cxt) \
MemoryContextSetParent((erh)->hdr.eoh_context, cxt)
/* information returned by expanded_record_lookup_field() */ typedefstruct ExpandedRecordFieldInfo
{ int fnumber; /* field's attr number in record */
Oid ftypeid; /* field's type/typmod info */
int32 ftypmod;
Oid fcollation; /* field's collation if any */
} ExpandedRecordFieldInfo;
/* Get the tupdesc for the expanded record's actual type */ staticinline TupleDesc
expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
{ if (likely(erh->er_tupdesc != NULL)) return erh->er_tupdesc; else return expanded_record_fetch_tupdesc(erh);
}
/* Get value of record field */ staticinline Datum
expanded_record_get_field(ExpandedRecordHeader *erh, int fnumber, bool *isnull)
{ if ((erh->flags & ER_FLAG_DVALUES_VALID) &&
likely(fnumber > 0 && fnumber <= erh->nfields))
{
*isnull = erh->dnulls[fnumber - 1]; return erh->dvalues[fnumber - 1];
} else return expanded_record_fetch_field(erh, fnumber, isnull);
}
#endif/* EXPANDEDRECORD_H */
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.8Bemerkung:
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.