Skip to content

Exclude pgstream schema when cleaning up target database#740

Merged
kvch merged 1 commit into
mainfrom
fix-do-not-clean-pgstream-schema-and-triggers
Mar 5, 2026
Merged

Exclude pgstream schema when cleaning up target database#740
kvch merged 1 commit into
mainfrom
fix-do-not-clean-pgstream-schema-and-triggers

Conversation

@kvch
Copy link
Copy Markdown
Collaborator

@kvch kvch commented Feb 24, 2026

Description

This PR excludes the schema pgstream from dropped objects when clean_target_db is set and pgstream schema is in the target database.

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 SCHEMA pgstream is filtered out when clean_target_db is set and pgstream is in the target db

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

@kvch kvch marked this pull request as draft February 26, 2026 18:18
@kvch kvch force-pushed the fix-do-not-clean-pgstream-schema-and-triggers branch from 5bd2a9b to f14c056 Compare March 4, 2026 16:59
@kvch kvch force-pushed the fix-do-not-clean-pgstream-schema-and-triggers branch from f14c056 to f0d048a Compare March 4, 2026 17:00
@kvch kvch marked this pull request as ready for review March 4, 2026 17:00
@kvch kvch requested a review from tsg March 4, 2026 17:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

Merging this branch will increase overall coverage

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

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore/pg_options_generator.go 100.00% (ø) 77 (+1) 77 (+1) 0

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/pg_options_generator_test.go
  • github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore/snapshot_pg_dump_restore_generator_test.go

@kvch kvch requested a review from exekias March 5, 2026 10:26
@kvch kvch merged commit a6ad9fe into main Mar 5, 2026
7 checks passed
@kvch kvch deleted the fix-do-not-clean-pgstream-schema-and-triggers branch March 5, 2026 11:16
@kvch kvch changed the title Exclude pgstream schema when cleaning up target table Exclude pgstream schema when cleaning up target database Mar 5, 2026
spongenee pushed a commit to atvenu/pgstream that referenced this pull request Apr 21, 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.

Query on full Logical DB Replication without specifying all the tables

2 participants