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)
262 att->attnotnull =
false;
263 att->atthasdef =
false;
264 att->atthasmissing =
false;
265 att->attidentity =
'\0';
266 att->attgenerated =
'\0';
310 att->attnotnull =
false;
311 att->atthasdef =
false;
312 att->atthasmissing =
false;
313 att->attidentity =
'\0';
314 att->attgenerated =
'\0';
368 for (
i =
cpy->num_defval - 1;
i >= 0;
i--)
376 for (
i = tupdesc->
natts - 1;
i >= 0;
i--)
393 for (
i =
cpy->num_check - 1;
i >= 0;
i--)
435 for (
i = 0;
i <
dst->natts;
i++)
439 att->attnotnull =
false;
440 att->atthasdef =
false;
441 att->atthasmissing =
false;
442 att->attidentity =
'\0';
443 att->attgenerated =
'\0';
453 dst->tdrefcount = -1;
490 dstAtt->attnotnull =
false;
491 dstAtt->atthasdef =
false;
492 dstAtt->atthasmissing =
false;
493 dstAtt->attidentity =
'\0';
494 dstAtt->attgenerated =
'\0';
510 int firstNonCachedOffsetAttr = 0;
511 int firstNonGuaranteedAttr = tupdesc->
natts;
514 for (
int i = 0;
i < tupdesc->
natts;
i++)
523 if (firstNonGuaranteedAttr == tupdesc->
natts &&
526 firstNonGuaranteedAttr =
i;
528 if (
cattr->attlen <= 0)
545 off +=
cattr->attlen;
546 firstNonCachedOffsetAttr =
i + 1;
581 for (
i = tupdesc->
natts - 1;
i >= 0;
i--)
690 if (
attr1->attcompression !=
attr2->attcompression)
700 if (
attr1->attnotnull)
716 if (
attr1->attgenerated !=
attr2->attgenerated)
718 if (
attr1->attisdropped !=
attr2->attisdropped)
724 if (
attr1->attcollation !=
attr2->attcollation)
738 if (
constr1->has_generated_stored !=
constr2->has_generated_stored)
740 if (
constr1->has_generated_virtual !=
constr2->has_generated_virtual)
743 if (n != (
int)
constr2->num_defval)
746 for (
i = 0;
i < n;
i++)
780 if (n != (
int)
constr2->num_check)
788 for (
i = 0;
i < n;
i++)
850 if (
attr1->attcollation !=
attr2->attcollation)
854 if (
attr1->attisdropped !=
attr2->attisdropped)
934 att->atttypmod = typmod;
939 att->attnotnull =
false;
940 att->atthasdef =
false;
941 att->atthasmissing =
false;
942 att->attidentity =
'\0';
943 att->attgenerated =
'\0';
944 att->attisdropped =
false;
945 att->attislocal =
true;
946 att->attinhcount = 0;
997 att->atttypmod = typmod;
1002 att->attnotnull =
false;
1003 att->atthasdef =
false;
1004 att->atthasmissing =
false;
1005 att->attidentity =
'\0';
1006 att->attgenerated =
'\0';
1007 att->attisdropped =
false;
1008 att->attislocal =
true;
1009 att->attinhcount = 0;
1024 att->attbyval =
false;
1033 att->attbyval =
true;
1042 att->attbyval =
true;
1051 att->attbyval =
true;
1060 att->attbyval =
true;
1127 forfour(l1, names, l2,
types, l3, typmods, l4, collations)
1188 return psprintf(
"TupleDesc %p (%u,%d)",
#define Assert(condition)
#define MemSet(start, val, len)
bool IsCatalogRelationOid(Oid relid)
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)