You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A PostgreSQL extension that automatically synchronizes role and permission changes (CREATE ROLE, GRANT, REVOKE, ALTER ROLE, DROP ROLE, etc.) across all configured environments — dev, test, pre-prod, production — with full audit logging and retry capabilities.
Installation
Prerequisites
PostgreSQL 12+
pgcrypto and dblink extensions (auto-installed as dependencies)
Superuser access on the source database
The sync user on each target must have CREATEROLE and relevant GRANT privileges
Network connectivity from source to all target hosts
Install
# Clone the repository
git clone https://github.com/YOUR_ORG/pgx_permission_sync.git
cd pgx_permission_sync
# Build and install (requires pg_config in PATH)
make install
# Or specify pg_config location
make PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config install
Enable in your database
-- Install the extension (auto-installs dblink and pgcrypto)
CREATE EXTENSION pgx_permission_sync CASCADE;
-- VerifySELECT*FROMdba_pgx_permission_sync.extension_metadata;
Uninstall
-- First drop event triggers and roles (they are cluster-wide)
\i /path/to/sql/uninstall.sql-- Then drop the extension
DROP EXTENSION pgx_permission_sync CASCADE;
-- This automatically replicates to all environments:
CREATE ROLE app_reader LOGIN PASSWORD 'reader_pass';
GRANTSELECTON ALL TABLES IN SCHEMA public TO app_reader;
PostgreSQL extension that automatically synchronizes role and permission changes (CREATE ROLE, GRANT, REVOKE, ALTER ROLE, DROP ROLE) across multiple environments (dev, test, pre-prod, production) via event triggers and dblink, with full audit logging, encrypted credentials, retry queue, and sync rules per environment.