static ObjectAddress ATExecDropNotNull(Relation rel, const char *colName, bool recurse,
LOCKMODE lockmode);
static void set_attnotnull(List **wqueue, Relation rel, AttrNumber attnum,
- bool is_valid, bool queue_validation);
+ bool queue_validation);
static ObjectAddress ATExecSetNotNull(List **wqueue, Relation rel,
char *conName, char *colName,
bool recurse, bool recursing,
nncols = AddRelationNotNullConstraints(rel, stmt->nnconstraints,
old_notnulls, connames);
foreach_int(attrnum, nncols)
- set_attnotnull(NULL, rel, attrnum, true, false);
+ set_attnotnull(NULL, rel, attrnum, false);
ObjectAddressSet(address, RelationRelationId, relationId);
*/
static void
set_attnotnull(List **wqueue, Relation rel, AttrNumber attnum,
- bool is_valid, bool queue_validation)
+ bool queue_validation)
{
Form_pg_attribute attr;
- CompactAttribute *thisatt;
Assert(!queue_validation || wqueue);
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, RelationGetRelid(rel));
- thisatt = TupleDescCompactAttr(RelationGetDescr(rel), attnum - 1);
- thisatt->attnullability = ATTNULLABLE_VALID;
-
attr = (Form_pg_attribute) GETSTRUCT(tuple);
attr->attnotnull = true;
ObjectAddressSet(address, ConstraintRelationId, ccon->conoid);
/* Mark pg_attribute.attnotnull for the column and queue validation */
- set_attnotnull(wqueue, rel, attnum, true, true);
+ set_attnotnull(wqueue, rel, attnum, true);
InvokeObjectPostAlterHook(RelationRelationId,
RelationGetRelid(rel), attnum);
*/
if (constr->contype == CONSTR_NOTNULL)
set_attnotnull(wqueue, rel, ccon->attnum,
- !constr->skip_validation,
!constr->skip_validation);
ObjectAddressSet(address, ConstraintRelationId, ccon->conoid);
}
/* Set attnotnull appropriately without queueing another validation */
- set_attnotnull(NULL, rel, attnum, true, false);
+ set_attnotnull(NULL, rel, attnum, false);
tab = ATGetQueueEntry(wqueue, rel);
tab->verify_new_notnull = true;