Skip to content

pgEdge Spock 5.0.4 + snowflake extensions#2050

Closed
nightness wants to merge 9 commits intosupabase:developfrom
Brainwires:develop
Closed

pgEdge Spock 5.0.4 + snowflake extensions#2050
nightness wants to merge 9 commits intosupabase:developfrom
Brainwires:develop

Conversation

@nightness
Copy link

This pull request introduces and documents support for the Spock bi-directional replication extension (v5.0.4) and the Snowflake unique ID generator extension (v2.4) for PostgreSQL 15, including their packaging, patches, and integration into the Nix-based build system. It also adds comprehensive operational documentation for Spock deployment, upgrade, production readiness, and critical issue handling. The changes also remove a deprecated extension whose repository has been deleted.

Extension Packaging and Integration:

  • Added new Nix expressions to package the Spock (spock.nix) and Snowflake (snowflake.nix) PostgreSQL extensions, supporting multi-version builds, versioned libraries, and, for Spock, the companion spock_output plugin and required build dependencies. Both are now included in the main PostgreSQL package set. [1] [2] [3]

  • Updated versions.json to track and verify the latest versions and hashes for Spock (5.0.4) and Snowflake (2.4), including supported PostgreSQL versions.

  • For Spock, expanded the set of PostgreSQL patches applied for version 15 to ensure compatibility and support for bi-directional replication features, such as logical decoding on standbys, delta apply functions, and improved commit timestamp handling.

  • Removed the deprecated pg_plan_filter extension from the build due to the upstream repository being deleted.

Operational Documentation and Production Guidance:

  • Added SPOCK_DEPLOYMENT_LOG.md and SPOCK_PRODUCTION_ISSUES.md with detailed, step-by-step instructions for deploying, upgrading, and operating Spock in bi-directional replication setups, including configuration, sequence management, CLI integration, monitoring, and production checklists. These documents also include critical issue workarounds, safe recovery procedures, and recommendations for conflict resolution strategies. [1] [2]

Summary of Most Important Changes:

1. Spock and Snowflake Extension Packaging and Integration

  • Added Nix build scripts for Spock (spock.nix) and Snowflake (snowflake.nix) with multi-version, versioned library, and extension control file support. Spock build includes spock_output plugin for v5.x. [1] [2]
  • Registered both extensions in the main PostgreSQL extension set and updated versions.json for reproducible builds. [1] [2]

2. Spock 5.0.4 Patch Management

  • Expanded PostgreSQL 15 patch list to support Spock 5.0.4, including new and updated patches for logical decoding, delta apply functions, and commit timestamp tracking.

3. Documentation for Deployment and Production

  • Added comprehensive Spock deployment, upgrade, and production readiness documentation, including migration steps, CLI integration, monitoring, and critical issue handling in new markdown files. [1] [2]

4. Extension Set Maintenance

  • Removed the deprecated pg_plan_filter extension from the build due to the upstream repository deletion.

5. Operational Best Practices

  • Documented best practices for sequence management, conflict resolution, safe recovery, and health checks for Spock bi-directional replication in production environments. [1] [2]Please go the the Preview tab and select the appropriate sub-template:

nightness and others added 9 commits January 24, 2026 14:15
- Add spock.nix extension definition with pam and zlib dependencies
- Add Spock 3.1.8 to versions.json with hash for PG15
- Add spock.nix to postgres.nix extensions list
- Add pg15-log_old_value-pg1514.diff patch for PostgreSQL 15.14
- Update generic.nix to apply Spock patch for PG15

Spock enables bi-directional logical replication between multiple
PostgreSQL nodes with conflict resolution support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Includes patches for:
- Logical decoding on standby servers
- Logical commit clock (Lamport clock) for transaction ordering
- Per-subtransaction commit timestamps
- Checkpoint hook for extensions
- Log old value support for conflict resolution
- Add SPOCK_PRODUCTION_ISSUES.md documenting critical issues:
  - Sequence conflicts and solutions
  - Initial sync failure troubleshooting
  - Apply worker crash recovery
- Add SPOCK_SYSTEM_SETUP.md with complete infrastructure guide:
  - Topology overview (PRIMARY/STANDBY)
  - Docker container architecture
  - Spock node configuration
  - Network configuration
  - CLI integration details
  - Key SQL commands reference
  - Troubleshooting guide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moved from supabase-cli to consolidate all Spock documentation:
- SPOCK_SCORECARD.md - Production readiness tests and monitoring queries
- SPOCK_DEPLOYMENT_LOG.md - Deployment steps and configuration guide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@encima
Copy link
Member

encima commented Feb 16, 2026

Hi @nightness
Thanks for the efforts here!
I do not believe we have any plans to add pgEdge support to Supabase Postgres and it would require changing how the platform manages projects.
For insight into our solution for distributed postgres, check out Multigres!

(Also, sidenote: pg_plan_filter has not been deleted)

@encima encima closed this Feb 16, 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.

2 participants