File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -696,13 +696,15 @@ variable_insert(PG_FUNCTION_ARGS)
696696 tupTypmod = HeapTupleHeaderGetTypMod (rec );
697697
698698 record = & (GetActualValue (variable ).record );
699- if (!record -> tupdesc )
699+ tupdesc = lookup_rowtype_tupdesc (tupType , tupTypmod );
700+
701+ if (!record -> tupdesc || variable -> is_deleted )
700702 {
701703 /*
702704 * This is the first record for the var_name. Initialize record.
703705 */
704- tupdesc = lookup_rowtype_tupdesc (tupType , tupTypmod );
705706 init_record (record , tupdesc , variable );
707+ variable -> is_deleted = false;
706708 }
707709 else if (LastTypeId == RECORDOID || !OidIsValid (LastTypeId ) ||
708710 LastTypeId != tupType )
@@ -711,16 +713,7 @@ variable_insert(PG_FUNCTION_ARGS)
711713 * We need to check attributes of the new row if this is a transient
712714 * record type or if last record has different id.
713715 */
714- tupdesc = lookup_rowtype_tupdesc (tupType , tupTypmod );
715- if (variable -> is_deleted )
716- {
717- init_record (record , tupdesc , variable );
718- variable -> is_deleted = false;
719- }
720- else
721- {
722- check_attributes (variable , tupdesc );
723- }
716+ check_attributes (variable , tupdesc );
724717 }
725718
726719 LastTypeId = tupType ;
You can’t perform that action at this time.
0 commit comments