Skip to content

refactor(subscriptions): extract user-managed SQL package - #56

Merged
psteinroe merged 3 commits into
mainfrom
refactor/subscriptions
Aug 11, 2026
Merged

refactor(subscriptions): extract user-managed SQL package#56
psteinroe merged 3 commits into
mainfrom
refactor/subscriptions

Conversation

@psteinroe

@psteinroe psteinroe commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Move trigger-based subscriptions out of daemon-owned migrations into an optional SQL package under extensions/subscriptions. Subscription objects now live in pgstream_subscriptions and are installed by the application migration role, so the pgstream runtime no longer needs ownership of subscribed tables.

Breaking Upgrade

Existing installations must run extensions/subscriptions/upgrades/from-pgstream-0.1.sql before starting this version. The upgrade moves rows and functions with ALTER ... SET SCHEMA, preserving subscription UUIDs, generated function OIDs, and target-trigger dependencies; the core migration blocks non-empty legacy installations with an actionable hint.

User-Managed Lifecycle

The package includes fresh-install, upgrade, and uninstall SQL while retaining the existing drop-and-recreate trigger behavior. set_subscriptions() remains an optional example that users can copy and customize rather than part of the default installation.

Integration coverage verifies restricted runtime privileges, fresh installation, optional reconciliation, legacy upgrade preservation, uninstall cleanup, and existing subscription event behavior across the updated test suite.

@psteinroe
psteinroe merged commit f07ad8e into main Aug 11, 2026
6 checks passed
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