]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Silence compiler warning from older compilers.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Mar 2026 21:25:12 +0000 (17:25 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Mar 2026 21:25:12 +0000 (17:25 -0400)
Our RHEL7-vintage buildfarm animals are complaining about
"the comparison will always evaluate as true" for a usage of
SOFT_ERROR_OCCURRED() on a local variable.  This is the same
issue addressed in 7bc88c3d6 and some earlier commits, so solve
it the same way: write "escontext.error_occurred" instead.

Problem dates to recent commit a0b6ef29a, no need for back-patch.

src/backend/commands/tablecmds.c

index 219f604df7b116b2b752a71597d4e61674ad7f3e..c69c12dc014d7fae52cc5993cbb1f4bb264f86cb 100644 (file)
@@ -7628,7 +7628,7 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
                                 * Phase 3 will re-evaluate with hard errors, so the user gets
                                 * an error only if the table has rows.
                                 */
-                               if (SOFT_ERROR_OCCURRED(&escontext))
+                               if (escontext.error_occurred)
                                {
                                        missingIsNull = true;
                                        tab->rewrite |= AT_REWRITE_DEFAULT_VAL;