97 for (
i = 0;
i < 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--)
244 att->attnotnull =
false;
245 att->atthasdef =
false;
246 att->atthasmissing =
false;
247 att->attidentity =
'\0';
248 att->attgenerated =
'\0';
279 Assert(srcAttno <= src->natts);
281 Assert(dstAttno <= dst->natts);
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';
333 for (
i = tupdesc->
natts - 1;
i >= 0;
i--)
335 if (attrmiss[
i].am_present
412 for (
i = 0;
i < tupdesc1->
natts;
i++)
430 if (strcmp(
NameStr(attr1->attname),
NameStr(attr2->attname)) != 0)
432 if (attr1->atttypid != attr2->atttypid)
434 if (attr1->attstattarget != attr2->attstattarget)
436 if (attr1->attlen != attr2->attlen)
438 if (attr1->attndims != attr2->attndims)
440 if (attr1->atttypmod != attr2->atttypmod)
442 if (attr1->attbyval != attr2->attbyval)
444 if (attr1->attalign != attr2->attalign)
446 if (attr1->attstorage != attr2->attstorage)
448 if (attr1->attcompression != attr2->attcompression)
450 if (attr1->attnotnull != attr2->attnotnull)
452 if (attr1->atthasdef != attr2->atthasdef)
454 if (attr1->attidentity != attr2->attidentity)
456 if (attr1->attgenerated != attr2->attgenerated)
458 if (attr1->attisdropped != attr2->attisdropped)
460 if (attr1->attislocal != attr2->attislocal)
462 if (attr1->attinhcount != attr2->attinhcount)
464 if (attr1->attcollation != attr2->attcollation)
469 if (tupdesc1->
constr != NULL)
484 for (
i = 0;
i < n;
i++)
491 if (strcmp(defval1->
adbin, defval2->
adbin) != 0)
498 for (
i = 0;
i < tupdesc1->
natts;
i++)
510 missatt1->attbyval, missatt1->attlen))
526 for (
i = 0;
i < n;
i++)
538 else if (tupdesc2->
constr != NULL)
585 const char *attributeName,
598 Assert(attributeNumber >= 1);
599 Assert(attributeNumber <= desc->natts);
613 if (attributeName == NULL)
615 else if (attributeName !=
NameStr(att->attname))
618 att->attstattarget = -1;
619 att->attcacheoff = -1;
620 att->atttypmod = typmod;
622 att->attnum = attributeNumber;
623 att->attndims = attdim;
625 att->attnotnull =
false;
626 att->atthasdef =
false;
627 att->atthasmissing =
false;
628 att->attidentity =
'\0';
629 att->attgenerated =
'\0';
630 att->attisdropped =
false;
631 att->attislocal =
true;
632 att->attinhcount = 0;
637 elog(
ERROR,
"cache lookup failed for type %u", oidtypeid);
640 att->atttypid = oidtypeid;
641 att->attlen = typeForm->typlen;
642 att->attbyval = typeForm->typbyval;
643 att->attalign = typeForm->typalign;
644 att->attstorage = typeForm->typstorage;
646 att->attcollation = typeForm->typcollation;
659 const char *attributeName,
668 Assert(attributeNumber >= 1);
669 Assert(attributeNumber <= desc->natts);
676 Assert(attributeName != NULL);
679 att->attstattarget = -1;
680 att->attcacheoff = -1;
681 att->atttypmod = typmod;
683 att->attnum = attributeNumber;
684 att->attndims = attdim;
686 att->attnotnull =
false;
687 att->atthasdef =
false;
688 att->atthasmissing =
false;
689 att->attidentity =
'\0';
690 att->attgenerated =
'\0';
691 att->attisdropped =
false;
692 att->attislocal =
true;
693 att->attinhcount = 0;
696 att->atttypid = oidtypeid;
708 att->attbyval =
false;
709 att->attalign = TYPALIGN_INT;
710 att->attstorage = TYPSTORAGE_EXTENDED;
712 att->attcollation = DEFAULT_COLLATION_OID;
717 att->attbyval =
true;
718 att->attalign = TYPALIGN_CHAR;
719 att->attstorage = TYPSTORAGE_PLAIN;
726 att->attbyval =
true;
727 att->attalign = TYPALIGN_INT;
728 att->attstorage = TYPSTORAGE_PLAIN;
736 att->attalign = TYPALIGN_DOUBLE;
737 att->attstorage = TYPSTORAGE_PLAIN;
744 att->attbyval =
true;
745 att->attalign = TYPALIGN_INT;
746 att->attstorage = TYPSTORAGE_PLAIN;
752 elog(
ERROR,
"unsupported type %u", oidtypeid);
771 Assert(attributeNumber >= 1);
772 Assert(attributeNumber <= desc->natts);
774 TupleDescAttr(desc, attributeNumber - 1)->attcollation = collationid;
804 has_not_null =
false;
833 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
834 errmsg(
"column \"%s\" cannot be declared SETOF",
838 atttypid, atttypmod, attdim);
844 att->attstorage = entry->
storage;
862 constr->
check = NULL;
907 forfour(l1, names, l2,
types, l3, typmods, l4, collations)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
void aclcheck_error_type(AclResult aclerr, Oid typeOid)
#define PointerIsValid(pointer)
#define MemSet(start, val, len)
Datum datumCopy(Datum value, bool typByVal, int typLen)
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
elog(ERROR, "%s: %s", p2, msg)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static Datum hash_uint32(uint32 k)
static uint32 hash_combine(uint32 a, uint32 b)
#define HeapTupleIsValid(tuple)
Assert(fmt[strlen(fmt) - 1] !='\n')
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
void namestrcpy(Name name, const char *str)
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
Oid GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid)
#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)
FormData_pg_type * Form_pg_type
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
ResourceOwner CurrentResourceOwner
void ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
void ResourceOwnerRememberTupleDesc(ResourceOwner owner, TupleDesc tupdesc)
void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner)
bool has_generated_stored
struct AttrMissing * missing
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define InvalidCompressionMethod
TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc)
void TupleDescCopy(TupleDesc dst, TupleDesc src)
TupleDesc BuildDescForRelation(List *schema)
void DecrTupleDescRefCount(TupleDesc tupdesc)
void FreeTupleDesc(TupleDesc tupdesc)
void IncrTupleDescRefCount(TupleDesc tupdesc)
TupleDesc CreateTemplateTupleDesc(int natts)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
void TupleDescInitBuiltinEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
uint32 hashTupleDesc(TupleDesc desc)
TupleDesc BuildDescFromLists(List *names, List *types, List *typmods, List *collations)
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)
#define TupleDescSize(src)
struct TupleDescData * TupleDesc
#define TupleDescAttr(tupdesc, i)