{"id":51495784,"url":"https://github.com/willibrandon/pgl_validate","last_synced_at":"2026-07-07T15:01:41.989Z","repository":{"id":367452578,"uuid":"1280877519","full_name":"willibrandon/pgl_validate","owner":"willibrandon","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-26T05:03:58.000Z","size":203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-26T05:08:17.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willibrandon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-26T02:52:47.000Z","updated_at":"2026-06-26T05:04:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/willibrandon/pgl_validate","commit_stats":null,"previous_names":["willibrandon/pgl_validate"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/willibrandon/pgl_validate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fpgl_validate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fpgl_validate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fpgl_validate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fpgl_validate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willibrandon","download_url":"https://codeload.github.com/willibrandon/pgl_validate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fpgl_validate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35232326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-07T15:01:40.265Z","updated_at":"2026-07-07T15:01:41.961Z","avatar_url":"https://github.com/willibrandon.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgl_validate\n\n`pgl_validate` is a PostgreSQL extension for validating table contents across\npglogical and PostgreSQL logical-replication topologies. The primary target is\nbidirectional replication, where validation must distinguish real divergence\nfrom replication lag, filtered replication contracts, and expected sequence\nwindows. Physical standbys are supported with a standby-specific fence.\n\n## Supported Scope\n\n- PostgreSQL 15, 16, 17, and 18.\n- pglogical validation, including bidirectional topologies.\n- Native logical replication validation.\n- Physical standby validation.\n- Windows, Linux, and macOS builds.\n- Linux and macOS `.tar.gz` packages for each supported PostgreSQL major.\n- Windows `.zip` packages for each supported PostgreSQL major.\n- Windows x64 MSI installers for each supported PostgreSQL major.\n\npglogical support is first-class and release-gated. It is not a runtime\nprerequisite for native logical replication or physical standby validation.\nFull CI installs pglogical because the test suite exercises pglogical code\npaths. Production installations need pglogical only on pglogical participants.\n\nCI covers the Windows-capable pglogical fork and vanilla upstream pglogical\nwhere upstream has a normal source-build path. Fork-only queryable conflict\nhistory is used only as report enrichment; validation does not depend on it.\n\n## Quick Start\n\nInstall the extension for your platform and PostgreSQL major: download a release\npackage from the [releases page](https://github.com/willibrandon/pgl_validate/releases),\nor build it from source (see [Development](#development)). Then, in the target\ndatabase:\n\n```sql\nCREATE EXTENSION pgl_validate;\n\nSELECT *\nFROM pgl_validate.compare_table('public.accounts'::regclass);\n```\n\nFor pglogical validation, register the databases you want to compare. The\nhelper is safe to rerun.\n\n```sql\nSELECT *\nFROM pgl_validate.register_pglogical_peer(\n    p_peer_name =\u003e 'node_beta',\n    p_peer_dsn  =\u003e 'host=localhost port=5432 dbname=db_beta user=postgres'\n);\n\nSELECT *\nFROM pgl_validate.compare_table('public.accounts'::regclass, ARRAY['node_beta']);\n```\n\nTwo pglogical nodes may live in separate databases on the same PostgreSQL\ninstance. The DSN still identifies the peer because `dbname` is part of the\nendpoint.\n\nWhen a comparison reports differences, `generate_repair` renders the confirmed\ndivergences as SQL keyed to whichever node you treat as authoritative (`local`\nis the database you are connected to), so you can read them before anything\nruns:\n\n```sql\nSELECT pgl_validate.generate_repair(run_id =\u003e 42, authoritative =\u003e 'local');\n```\n\n`apply_repair` runs that same set against the target and re-validates in the\nsame call. It writes under its own replication origin so the change stays on the\ntarget, touches only the keys the run already confirmed, and never modifies the\nauthoritative node. `confirm` must equal `target`, a deliberate guard against\nrepairing the wrong database:\n\n```sql\nSELECT *\nFROM pgl_validate.apply_repair(\n    run_id        =\u003e 42,\n    authoritative =\u003e 'local',\n    target        =\u003e 'node_beta',\n    confirm       =\u003e 'node_beta'\n);\n```\n\nRepair is explicit and privileged; nothing changes until you call\n`apply_repair`.\n\n## Development\n\nUse Rust stable with `cargo-pgrx` 0.19.1.\n\n```sh\nrustup default stable\ncargo install --locked cargo-pgrx --version 0.19.1\n```\n\nBuild and install against the PostgreSQL major you target, pointing\n`--pg-config` at that installation:\n\n```sh\ncargo pgrx install \\\n  --pg-config /path/to/pg_config \\\n  --no-default-features \\\n  --features pg18\n```\n\nOn Windows, run that command through `scripts\\pgrx-vs.ps1` so bindgen can see\nthe Visual Studio C++ and Windows SDK headers.\n\nCommon checks:\n\n```sh\npwsh -NoProfile -File scripts/check-powershell.ps1\npwsh -NoProfile -File scripts/check-design-catalog-ddl.ps1\npwsh -NoProfile -File scripts/test-pgrx.ps1 -PgMajor 18\npwsh -NoProfile -File scripts/test-pglogical-fence.ps1 -PgMajor 18\n```\n\nScript details live in [scripts/README.md](scripts/README.md). The design\ncontract lives in [docs/design.md](docs/design.md).\n\n## Releases\n\nThe first release line starts at `v0.1.0`.\n\nRelease packages are produced with `cargo pgrx package` through\n`scripts/package-pgrx.ps1`. Windows MSI installers are produced with\n`scripts/package-windows-msi.ps1`.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibrandon%2Fpgl_validate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillibrandon%2Fpgl_validate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibrandon%2Fpgl_validate/lists"}