@@ -15919,7 +15919,6 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
15919
15919
HeapTuple tuple;
15920
15920
HeapTuple newtuple;
15921
15921
Datum datum;
15922
- bool isnull;
15923
15922
Datum newOptions;
15924
15923
Datum repl_val[Natts_pg_class];
15925
15924
bool repl_null[Natts_pg_class];
@@ -15944,18 +15943,20 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
15944
15943
* there were none before.
15945
15944
*/
15946
15945
datum = (Datum) 0;
15947
- isnull = true;
15948
15946
}
15949
15947
else
15950
15948
{
15949
+ bool isnull;
15950
+
15951
15951
/* Get the old reloptions */
15952
15952
datum = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
15953
15953
&isnull);
15954
+ if (isnull)
15955
+ datum = (Datum) 0;
15954
15956
}
15955
15957
15956
15958
/* Generate new proposed reloptions (text array) */
15957
- newOptions = transformRelOptions(isnull ? (Datum) 0 : datum,
15958
- defList, NULL, validnsps, false,
15959
+ newOptions = transformRelOptions(datum, defList, NULL, validnsps, false,
15959
15960
operation == AT_ResetRelOptions);
15960
15961
15961
15962
/* Validate */
@@ -16065,18 +16066,20 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
16065
16066
* pretend there were none before.
16066
16067
*/
16067
16068
datum = (Datum) 0;
16068
- isnull = true;
16069
16069
}
16070
16070
else
16071
16071
{
16072
+ bool isnull;
16073
+
16072
16074
/* Get the old reloptions */
16073
16075
datum = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
16074
16076
&isnull);
16077
+ if (isnull)
16078
+ datum = (Datum) 0;
16075
16079
}
16076
16080
16077
- newOptions = transformRelOptions(isnull ? (Datum) 0 : datum,
16078
- defList, "toast", validnsps, false,
16079
- operation == AT_ResetRelOptions);
16081
+ newOptions = transformRelOptions(datum, defList, "toast", validnsps,
16082
+ false, operation == AT_ResetRelOptions);
16080
16083
16081
16084
(void) heap_reloptions(RELKIND_TOASTVALUE, newOptions, true);
16082
16085
0 commit comments