Skip to content

feat: on_error=continue for schema/database clone (discussion #41) - #42

Merged
valehdba merged 2 commits into
mainfrom
feat/continue-on-error
Nov 18, 2026
Merged

valehdba merged 2 commits into
mainfrom
feat/continue-on-error

Conversation

@valehdba

@valehdba valehdba commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Adds an opt-in "on_error": "continue" option to pgclone.schema() and pgclone.database().

  • Each table runs in its own subtransaction; a failure is rolled back, reported as a WARNING (message + SQLSTATE) and the clone continues.
  • FK and trigger passes skip failed tables.
  • Returns COMPLETED WITH ERRORS: N table(s) failed: ... instead of OK. Default stays abort.
  • Cancel/shutdown are never swallowed; the failed table's libpq connections are closed.
  • schema_async() already continued past failed tables (job ends failed), so it needs no change.

New test/test_continue_on_error.sh (7 checks) is wired into run_tests.sh; it passed in the Docker suites for PG14-18.

Discussion: #41

A failing table is rolled back in its own subtransaction, reported with a WARNING, skipped from FK/trigger passes, and the clone continues. Default stays abort.
@valehdba
valehdba merged commit 745289b into main Nov 18, 2026
22 checks passed
@valehdba
valehdba deleted the feat/continue-on-error branch November 18, 2026 16:05
@valehdba valehdba mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant