We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent1db5667 commite33884dCopy full SHA for e33884d
src/backend/commands/tablecmds.c
@@ -9648,6 +9648,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
9648
DatumvaluesAtt[Natts_pg_attribute];
9649
boolnullsAtt[Natts_pg_attribute];
9650
boolreplacesAtt[Natts_pg_attribute];
9651
+HeapTuplenewTup;
9652
9653
MemSet(valuesAtt,0,sizeof(valuesAtt));
9654
MemSet(nullsAtt, false,sizeof(nullsAtt));
@@ -9673,8 +9674,10 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
9673
9674
replacesAtt[Anum_pg_attribute_attmissingval-1]= true;
9675
nullsAtt[Anum_pg_attribute_attmissingval-1]= false;
9676
-heapTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9677
-valuesAtt,nullsAtt,replacesAtt);
+newTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9678
+valuesAtt,nullsAtt,replacesAtt);
9679
+heap_freetuple(heapTup);
9680
+heapTup=newTup;
9681
attTup= (Form_pg_attribute)GETSTRUCT(heapTup);
9682
}
9683