Skip to content

Conversation

@eminano
Copy link
Collaborator

@eminano eminano commented Nov 19, 2025

Description

This PR updates pgstream to support Neon databases, adding an onboarding document. Additionally, it resolves an issue with the pgstream initialisation, where the schema_migrations table was being created in the public schema instead of the pgstream one, since the search_path was likely being ignored/overwritten. Instead, the qualified table is provided to the migrator so that it's created in the proper path.

Onboarding doc preview link.

Related Issue(s)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 📚 Documentation update

Changes Made

  • Exclude Neon managed roles from the role snapshot
  • Update the migrator to select the migrations table instead of using the search path
  • Add Neon onboarding documentation

Testing

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Neon databases in pgstream by excluding Neon-managed roles from snapshots and fixing a bug where the schema_migrations table was created in the wrong schema. The PR includes comprehensive onboarding documentation for using pgstream with Neon databases.

  • Excludes Neon-managed roles (cloud_admin, neondb_owner, neon_service, neon_superuser) from role snapshots
  • Fixes schema migrations table creation by using schema-qualified table name with the migrate library instead of relying on search_path
  • Adds detailed Neon onboarding guide covering snapshots and replication workflows

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/stream/stream_init.go Updates migrator to use schema-qualified pgstream.schema_migrations table via URL parameters instead of relying on search_path
pkg/snapshot/generator/postgres/schema/pgdumprestore/pg_role_parser.go Adds exclusion map for Neon-managed roles to prevent them from being included in role snapshots
docs/neon.md Adds comprehensive onboarding guide for Neon databases covering snapshots, replication, privileges, and troubleshooting
docs/privileges.md Adds link to the new Neon onboarding guide
README.md Updates documentation index to include Neon guide

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eminano eminano requested review from exekias and gulcin November 19, 2025 13:02
@github-actions
Copy link

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/snapshot/generator/postgres/schema/pgdumprestore 87.52% (-0.13%) 👎
github.com/xataio/pgstream/pkg/stream 36.21% (ø)

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_role_parser.go 96.30% (-0.87%) 108 (+2) 104 (+1) 4 (+1) 👎
github.com/xataio/pgstream/pkg/stream/stream_init.go 6.74% (ø) 89 6 83

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.

Copy link
Collaborator

@gulcin gulcin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome docs, and so easy to read 🚀

@eminano eminano merged commit aa89a2d into main Nov 20, 2025
7 checks passed
@eminano eminano deleted the neon-integration branch November 20, 2025 14:33
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.

Test pgstream against Neon

3 participants