pg.ddx.io pgpartman/pg_partman GitHub issues and pull requests
help / color / mirror / Atom feed[pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
9+ messages / 3 participants
[nested] [flat]
* [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-04-23 16:50 "Faithfinder (@Faithfinder)" <noreply+Faithfinder@github.com>
0 siblings, 0 replies; 9+ messages in thread
From: Faithfinder (@Faithfinder) @ 2026-04-23 16:50 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
# Problem
If run_maintenance() raises an unhandled exception for any table, the exception propagates out of the EXECUTE in the loop and aborts the entire procedure. All subsequent tables in the iteration are silently skipped.
A single misconfigured table causes all other partition sets to miss their maintenance window.
# Proposed change
Add p_skip_on_error boolean DEFAULT false to run_maintenance_proc(). When true, wrap each loop iteration in an exception block, emit a WARNING with the table name and error, and continue:
```sql
BEGIN
EXECUTE v_sql;
COMMIT;
EXCEPTION WHEN OTHERS THEN
ROLLBACK;
RAISE WARNING 'run_maintenance_proc: skipping % due to: % (%)',
v_row.parent_table, SQLERRM, SQLSTATE;
END;
```
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-04-23 17:30 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-04-23 17:30 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 assigned @keithf4.
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-04-23 17:30 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-04-23 17:30 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Thank you! I'll look at getting this incorporated into the next release
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-04-23 17:31 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-04-23 17:31 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 set milestone to "Next Patch".
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-04-23 17:31 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-04-23 17:31 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 applied label "confirmed bug".
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-10-04 21:52 "avinashvallarapu (@avinashvallarapu)" <noreply+avinashvallarapu@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: avinashvallarapu (@avinashvallarapu) @ 2026-10-04 21:52 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Looks like 5.5.0 already covers this. `run_maintenance()` now catches errors per partition set, logs a WARNING, sets `maintenance_last_run` to NULL for that set and moves on (the CVE-2026-61822 change). `run_maintenance_proc()` calls it once per set, so one broken set no longer stops the others.
I tried it on the `551` branch with PG 18.6: two sets, the first with a bad `partition_interval` and `maintenance_order = 1`. After `CALL partman.run_maintenance_proc()` the first was skipped with the warning and the second went from 6 to 11 children.
Side note on the code in the issue: PL/pgSQL doesn't allow `COMMIT` or `ROLLBACK` inside a block that has an `EXCEPTION` clause, so the commit has to stay outside it, the way the procedure does it now.
I think this one can be closed.
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-10-28 13:52 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-10-28 13:52 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 closed this.
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-10-28 13:52 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-10-28 13:52 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Closing this since 5.5.0 already covered this with a warning. Please feel free to re-open if you think this still needs to be looked into.
^ permalink raw [nested|flat] 9+ messages in thread
* Re: [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc()
@ 2026-10-28 13:53 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
7 siblings, 0 replies; 9+ messages in thread
From: keithf4 (@keithf4) @ 2026-10-28 13:53 UTC (permalink / raw)
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
@keithf4 applied label "fixed in current release".
^ permalink raw [nested|flat] 9+ messages in thread
end of thread, other threads:[~2026-10-28 13:53 UTC | newest]
Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-23 16:50 [pgpartman/pg_partman] issue #860: Feature: p_skip_on_error parameter for run_maintenance_proc() "Faithfinder (@Faithfinder)" <noreply+Faithfinder@github.com>
2026-04-23 17:30 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-23 17:30 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-23 17:31 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-23 17:31 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-04 21:52 ` "avinashvallarapu (@avinashvallarapu)" <noreply+avinashvallarapu@github.com>
2026-10-28 13:52 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-28 13:52 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-28 13:53 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox