Skip to content

Exclude pgstream schema when cleaning up target table#740

Draft
kvch wants to merge 1 commit intomainfrom
fix-do-not-clean-pgstream-schema-and-triggers
Draft

Exclude pgstream schema when cleaning up target table#740
kvch wants to merge 1 commit intomainfrom
fix-do-not-clean-pgstream-schema-and-triggers

Conversation

@kvch
Copy link
Collaborator

@kvch kvch commented Feb 24, 2026

Description

This PR excludes the schema pgstream from dropped objects when clean_target_db is set.
It also prevents dropping triggers of pgstream.

Related Issue(s)

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Changes Made

  • DROP EVENT TRIGGER is filtered out when clean_target_db is set
  • DROP SCHEMA pgstream is filtered out when clean_target_db is set

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

Needs manual verification

@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore 89.78% (+0.67%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore/snapshot_pg_dump_restore_generator.go 85.48% (+2.37%) 365 (+63) 312 (+61) 53 (+2) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore/snapshot_pg_dump_restore_generator_test.go

@kvch kvch marked this pull request as draft February 26, 2026 18:18
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.

Query on full Logical DB Replication without specifying all the tables

1 participant