Skip to content

Commit b0bd828

Browse files
Fix compiler error when using PG_TRY..PG_FINALLY (#7530)
In #7505 we used PG_TRY() .. PG_FINALLY() but some CI configurations was not happy with it reporting "variable might be clobbered by longjmp". Fixed it by using PG_TRY() .. PG_CATCH() instead. https://github.com/timescale/timescaledb/actions/runs/12277548387/job/34257269473#step:13:206 Disable-check: force-changelog-file
1 parent af6e5a6 commit b0bd828

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tsl/src/continuous_aggs/materialize.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Please see the included NOTICE for copyright information and
44
* LICENSE-TIMESCALE for a copy of the license.
55
*/
6-
#include <compat/compat.h>
76
#include <postgres.h>
87
#include <executor/spi.h>
98
#include <fmgr.h>
@@ -20,6 +19,7 @@
2019
#include <utils/snapmgr.h>
2120
#include <utils/timestamp.h>
2221

22+
#include "compat/compat.h"
2323
#include "debug_assert.h"
2424
#include "guc.h"
2525
#include "materialize.h"
@@ -770,11 +770,15 @@ execute_materializations(MaterializationContext *context)
770770
rows_processed += execute_materialization_plan(context, PLAN_TYPE_DELETE);
771771
rows_processed += execute_materialization_plan(context, PLAN_TYPE_INSERT);
772772
}
773+
774+
/* Free all cached plans */
775+
free_materialization_plans(context);
773776
}
774-
PG_FINALLY();
777+
PG_CATCH();
775778
{
776779
/* Make sure all cached plans in the session be released before rethrowing the error */
777780
free_materialization_plans(context);
781+
PG_RE_THROW();
778782
}
779783
PG_END_TRY();
780784

0 commit comments

Comments
 (0)