40 .
name =
"tupdesc reference",
70 dst->attcacheoff = -1;
71 dst->attlen = src->attlen;
73 dst->attbyval = src->attbyval;
75 dst->atthasmissing = src->atthasmissing;
76 dst->attisdropped = src->attisdropped;
77 dst->attgenerated = (src->attgenerated !=
'\0');
127#ifdef USE_ASSERT_CHECKING
223 for (
i = 0;
i < natts; ++
i)
263 att->attnotnull =
false;
264 att->atthasdef =
false;
265 att->atthasmissing =
false;
266 att->attidentity =
'\0';
267 att->attgenerated =
'\0';
312 att->attnotnull =
false;
313 att->atthasdef =
false;
314 att->atthasmissing =
false;
315 att->attidentity =
'\0';
316 att->attgenerated =
'\0';
371 for (
i =
cpy->num_defval - 1;
i >= 0;
i--)
379 for (
i = tupdesc->
natts - 1;
i >= 0;
i--)
396 for (
i =
cpy->num_check - 1;
i >= 0;
i--)
438 for (
i = 0;
i <
dst->natts;
i++)
442 att->attnotnull =
false;
443 att->atthasdef =
false;
444 att->atthasmissing =
false;
445 att->attidentity =
'\0';
446 att->attgenerated =
'\0';
456 dst->tdrefcount = -1;
493 dstAtt->attnotnull =
false;
494 dstAtt->atthasdef =
false;
495 dstAtt->atthasmissing =
false;
496 dstAtt->attidentity =
'\0';
497 dstAtt->attgenerated =
'\0';
513 int firstNonCachedOffsetAttr = 0;
514 int firstNonGuaranteedAttr = tupdesc->
natts;
517 for (
int i = 0;
i < tupdesc->
natts;
i++)
526 if (firstNonGuaranteedAttr == tupdesc->
natts &&
529 firstNonGuaranteedAttr =
i;
531 if (
cattr->attlen <= 0)
548 off +=
cattr->attlen;
549 firstNonCachedOffsetAttr =
i + 1;
584 for (
i = tupdesc->
natts - 1;
i >= 0;
i--)
693 if (
attr1->attcompression !=
attr2->attcompression)
703 if (
attr1->attnotnull)
719 if (
attr1->attgenerated !=
attr2->attgenerated)
721 if (
attr1->attisdropped !=
attr2->attisdropped)
727 if (
attr1->attcollation !=
attr2->attcollation)
741 if (
constr1->has_generated_stored !=
constr2->has_generated_stored)
743 if (
constr1->has_generated_virtual !=
constr2->has_generated_virtual)
746 if (n != (
int)
constr2->num_defval)
749 for (
i = 0;
i < n;
i++)
783 if (n != (
int)
constr2->num_check)
791 for (
i = 0;
i < n;
i++)
853 if (
attr1->attcollation !=
attr2->attcollation)
857 if (
attr1->attisdropped !=
attr2->attisdropped)
937 att->atttypmod = typmod;
942 att->attnotnull =
false;
943 att->atthasdef =
false;
944 att->atthasmissing =
false;
945 att->attidentity =
'\0';
946 att->attgenerated =
'\0';
947 att->attisdropped =
false;
948 att->attislocal =
true;
949 att->attinhcount = 0;
961 att->attstorage =
typeForm->typstorage;
963 att->attcollation =
typeForm->typcollation;
1000 att->atttypmod = typmod;
1005 att->attnotnull =
false;
1006 att->atthasdef =
false;
1007 att->atthasmissing =
false;
1008 att->attidentity =
'\0';
1009 att->attgenerated =
'\0';
1010 att->attisdropped =
false;
1011 att->attislocal =
true;
1012 att->attinhcount = 0;
1027 att->attbyval =
false;
1036 att->attbyval =
true;
1045 att->attbyval =
true;
1054 att->attbyval =
true;
1063 att->attbyval =
true;
1130 forfour(l1, names, l2,
types, l3, typmods, l4, collations)
1191 return psprintf(
"TupleDesc %p (%u,%d)",
#define Assert(condition)
#define MemSet(start, val, len)
bool IsCatalogRelationOid(Oid relid)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
Datum datumCopy(Datum value, bool typByVal, int typLen)
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
#define palloc0_object(type)
uint32 hash_bytes_uint32(uint32 k)
static uint32 hash_combine(uint32 a, uint32 b)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
char * pstrdup(const char *in)
void pfree(void *pointer)
void namestrcpy(Name name, const char *str)
#define ATTRIBUTE_FIXED_PART_SIZE
FormData_pg_attribute * Form_pg_attribute
static int list_length(const List *l)
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
END_CATALOG_STRUCT typedef FormData_pg_type * Form_pg_type
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
char * psprintf(const char *fmt,...)
void * stringToNode(const char *str)
ResourceOwner CurrentResourceOwner
void ResourceOwnerForget(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerRemember(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerEnlarge(ResourceOwner owner)
@ RESOURCE_RELEASE_AFTER_LOCKS
#define RELEASE_PRIO_TUPDESC_REFS
bool has_generated_virtual
bool has_generated_stored
struct AttrMissing * missing
int firstNonCachedOffsetAttr
CompactAttribute compact_attrs[FLEXIBLE_ARRAY_MEMBER]
int firstNonGuaranteedAttr
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
#define InvalidCompressionMethod
TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc)
void TupleDescCopy(TupleDesc dst, TupleDesc src)
static void populate_compact_attribute_internal(Form_pg_attribute src, CompactAttribute *dst)
Node * TupleDescGetDefault(TupleDesc tupdesc, AttrNumber attnum)
void DecrTupleDescRefCount(TupleDesc tupdesc)
void FreeTupleDesc(TupleDesc tupdesc)
void IncrTupleDescRefCount(TupleDesc tupdesc)
void verify_compact_attribute(TupleDesc tupdesc, int attnum)
TupleDesc CreateTemplateTupleDesc(int natts)
static void ResourceOwnerRememberTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
static void ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
void TupleDescFinalize(TupleDesc tupdesc)
static void ResOwnerReleaseTupleDesc(Datum res)
uint32 hashRowType(TupleDesc desc)
TupleDesc CreateTupleDescTruncatedCopy(TupleDesc tupdesc, int natts)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
void TupleDescInitBuiltinEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
static const ResourceOwnerDesc tupdesc_resowner_desc
TupleDesc BuildDescFromLists(const List *names, const List *types, const List *typmods, const List *collations)
void populate_compact_attribute(TupleDesc tupdesc, int attnum)
bool equalRowTypes(TupleDesc tupdesc1, TupleDesc tupdesc2)
void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid)
TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
void TupleDescCopyEntry(TupleDesc dst, AttrNumber dstAttno, TupleDesc src, AttrNumber srcAttno)
static char * ResOwnerPrintTupleDesc(Datum res)
#define TupleDescSize(src)
#define ATTNULLABLE_UNKNOWN
#define ATTNULLABLE_VALID
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
struct TupleDescData * TupleDesc
#define ATTNULLABLE_UNRESTRICTED
#define att_nominal_alignby(cur_offset, attalignby)
static uint8 typalign_to_alignby(char typalign)