97 for (i = 0; i < natts; ++
i)
127 for (i = 0; i < desc->
natts; i++)
131 att->attnotnull =
false;
132 att->atthasdef =
false;
133 att->atthasmissing =
false;
134 att->attidentity =
'\0';
135 att->attgenerated =
'\0';
184 for (i = tupdesc->
natts - 1; i >= 0; i--)
201 for (i = cpy->
num_check - 1; i >= 0; i--)
240 for (i = 0; i < dst->
natts; i++)
244 att->attnotnull =
false;
245 att->atthasdef =
false;
246 att->atthasmissing =
false;
247 att->attidentity =
'\0';
248 att->attgenerated =
'\0';
294 dstAtt->attnum = dstAttno;
295 dstAtt->attcacheoff = -1;
298 dstAtt->attnotnull =
false;
299 dstAtt->atthasdef =
false;
300 dstAtt->atthasmissing =
false;
301 dstAtt->attidentity =
'\0';
302 dstAtt->attgenerated =
'\0';
326 pfree(attrdef[i].adbin);
333 for (i = tupdesc->
natts - 1; i >= 0; i--)
335 if (attrmiss[i].am_present
347 pfree(check[i].ccname);
348 pfree(check[i].ccbin);
412 for (i = 0; i < tupdesc1->
natts; i++)
429 if (strcmp(
NameStr(attr1->attname),
NameStr(attr2->attname)) != 0)
431 if (attr1->atttypid != attr2->atttypid)
433 if (attr1->attstattarget != attr2->attstattarget)
435 if (attr1->attlen != attr2->attlen)
437 if (attr1->attndims != attr2->attndims)
439 if (attr1->atttypmod != attr2->atttypmod)
441 if (attr1->attbyval != attr2->attbyval)
443 if (attr1->attstorage != attr2->attstorage)
445 if (attr1->attalign != attr2->attalign)
447 if (attr1->attnotnull != attr2->attnotnull)
449 if (attr1->atthasdef != attr2->atthasdef)
451 if (attr1->attidentity != attr2->attidentity)
453 if (attr1->attgenerated != attr2->attgenerated)
455 if (attr1->attisdropped != attr2->attisdropped)
457 if (attr1->attislocal != attr2->attislocal)
459 if (attr1->attinhcount != attr2->attinhcount)
461 if (attr1->attcollation != attr2->attcollation)
466 if (tupdesc1->
constr != NULL)
481 for (i = 0; i < n; i++)
488 if (strcmp(defval1->
adbin, defval2->
adbin) != 0)
495 for (i = 0; i < tupdesc1->
natts; i++)
507 missatt1->attbyval, missatt1->attlen))
523 for (i = 0; i < n; i++)
535 else if (tupdesc2->
constr != NULL)
558 for (i = 0; i < desc->
natts; ++
i)
582 const char *attributeName,
596 AssertArg(attributeNumber <= desc->natts);
610 if (attributeName == NULL)
612 else if (attributeName !=
NameStr(att->attname))
615 att->attstattarget = -1;
616 att->attcacheoff = -1;
617 att->atttypmod = typmod;
619 att->attnum = attributeNumber;
620 att->attndims = attdim;
622 att->attnotnull =
false;
623 att->atthasdef =
false;
624 att->atthasmissing =
false;
625 att->attidentity =
'\0';
626 att->attgenerated =
'\0';
627 att->attisdropped =
false;
628 att->attislocal =
true;
629 att->attinhcount = 0;
634 elog(
ERROR,
"cache lookup failed for type %u", oidtypeid);
637 att->atttypid = oidtypeid;
638 att->attlen = typeForm->typlen;
639 att->attbyval = typeForm->typbyval;
640 att->attalign = typeForm->typalign;
641 att->attstorage = typeForm->typstorage;
642 att->attcollation = typeForm->typcollation;
660 const char *attributeName,
670 AssertArg(attributeNumber <= desc->natts);
677 Assert(attributeName != NULL);
680 att->attstattarget = -1;
681 att->attcacheoff = -1;
682 att->atttypmod = typmod;
684 att->attnum = attributeNumber;
685 att->attndims = attdim;
687 att->attnotnull =
false;
688 att->atthasdef =
false;
689 att->atthasmissing =
false;
690 att->attidentity =
'\0';
691 att->attgenerated =
'\0';
692 att->attisdropped =
false;
693 att->attislocal =
true;
694 att->attinhcount = 0;
697 att->atttypid = oidtypeid;
709 att->attbyval =
false;
710 att->attalign = TYPALIGN_INT;
711 att->attstorage = TYPSTORAGE_EXTENDED;
712 att->attcollation = DEFAULT_COLLATION_OID;
717 att->attbyval =
true;
718 att->attalign = TYPALIGN_CHAR;
719 att->attstorage = TYPSTORAGE_PLAIN;
725 att->attbyval =
true;
726 att->attalign = TYPALIGN_INT;
727 att->attstorage = TYPSTORAGE_PLAIN;
734 att->attalign = TYPALIGN_DOUBLE;
735 att->attstorage = TYPSTORAGE_PLAIN;
740 elog(
ERROR,
"unsupported type %u", oidtypeid);
760 AssertArg(attributeNumber <= desc->natts);
762 TupleDescAttr(desc, attributeNumber - 1)->attcollation = collationid;
792 has_not_null =
false;
821 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
822 errmsg(
"column \"%s\" cannot be declared SETOF",
826 atttypid, atttypmod, attdim);
832 att->attstorage = entry->
storage;
850 constr->
check = NULL;
895 forfour(l1, names, l2, types, l3, typmods, l4, collations)
void IncrTupleDescRefCount(TupleDesc tupdesc)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
TupleDesc BuildDescFromLists(List *names, List *types, List *typmods, List *collations)
TupleDesc CreateTemplateTupleDesc(int natts)
void namestrcpy(Name name, const char *str)
#define TupleDescAttr(tupdesc, i)
ResourceOwner CurrentResourceOwner
char * pstrdup(const char *in)
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
int errcode(int sqlerrcode)
#define MemSet(start, val, len)
uint32 hashTupleDesc(TupleDesc desc)
#define TupleDescSize(src)
void ResourceOwnerRememberTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
void aclcheck_error_type(AclResult aclerr, Oid typeOid)
static char GetDefaultToastCompression(void)
bool has_generated_stored
void pfree(void *pointer)
void TupleDescInitBuiltinEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
#define ObjectIdGetDatum(X)
void TupleDescCopyEntry(TupleDesc dst, AttrNumber dstAttno, TupleDesc src, AttrNumber srcAttno)
void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid)
FormData_pg_attribute * Form_pg_attribute
void ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
#define ATTRIBUTE_FIXED_PART_SIZE
void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner)
#define AssertArg(condition)
Datum datumCopy(Datum value, bool typByVal, int typLen)
static uint32 hash_combine(uint32 a, uint32 b)
#define IsStorageCompressible(storage)
Oid GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
void * palloc0(Size size)
void ReleaseSysCache(HeapTuple tuple)
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
static Datum hash_uint32(uint32 k)
void DecrTupleDescRefCount(TupleDesc tupdesc)
FormData_pg_type * Form_pg_type
static int list_length(const List *l)
void FreeTupleDesc(TupleDesc tupdesc)
#define DatumGetPointer(X)
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
struct AttrMissing * missing
#define InvalidCompressionMethod
void TupleDescCopy(TupleDesc dst, TupleDesc src)
struct TupleDescData * TupleDesc
int errmsg(const char *fmt,...)
bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
TupleDesc BuildDescForRelation(List *schema)
TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs)
AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode)
#define PointerIsValid(pointer)
#define offsetof(type, field)