{"id":41654385,"url":"https://github.com/cjfinnell/pgverify","last_synced_at":"2026-01-24T16:22:32.981Z","repository":{"id":41227842,"uuid":"449437313","full_name":"cjfinnell/pgverify","owner":"cjfinnell","description":"A Go module and CLI tool for comparing table contents of PostgreSQL wire protocol compatible databases","archived":false,"fork":false,"pushed_at":"2025-12-04T17:36:41.000Z","size":19469,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-07T02:22:48.422Z","etag":null,"topics":["cdc","cockroachdb","database","go","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjfinnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","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":"2022-01-18T20:29:48.000Z","updated_at":"2025-12-04T17:35:52.000Z","dependencies_parsed_at":"2024-06-20T00:05:56.301Z","dependency_job_id":"04c61be5-87e7-4afc-a1eb-49e1896e297d","html_url":"https://github.com/cjfinnell/pgverify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cjfinnell/pgverify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjfinnell%2Fpgverify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjfinnell%2Fpgverify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjfinnell%2Fpgverify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjfinnell%2Fpgverify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjfinnell","download_url":"https://codeload.github.com/cjfinnell/pgverify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjfinnell%2Fpgverify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28731225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cdc","cockroachdb","database","go","postgresql"],"created_at":"2026-01-24T16:22:30.644Z","updated_at":"2026-01-24T16:22:32.970Z","avatar_url":"https://github.com/cjfinnell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgverify\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/cjfinnell/pgverify/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/cjfinnell/pgverify/tree/main)\n[![codecov](https://codecov.io/github/cjfinnell/pgverify/graph/badge.svg?token=EF15U5QWIB)](https://codecov.io/github/cjfinnell/pgverify)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cjfinnell/pgverify)](https://goreportcard.com/report/github.com/cjfinnell/pgverify)\n\n`pgverify` is a tool for verifying consistency of data between different database engines.\n\n## Why?\n\nMigrating database engines can be a huge headache; newer relational databases often try to mitigate this by asserting some level of PostgreSQL syntax compatability, but there can be small differences in data types, output formats, etc that make it difficult to affirmatively verify that the actual data between instances is in-sync.\n\n`pgverify` attempts to solve this with a suite of various tests executed against the specified targets and compared for consistency, many of which generate per-table hashes from the data.\n\n## Getting started\n\nFirst, clone this repository and run `make build` to generate the `pgverify` binary. Then, run with specified targets as a list of PostrgeSQL syntax connection URIs:\n\n```\n$ pgverify postgresql://user1:passwd1@host1:port/database postgresql://user2:passwd2@host2:port/database [...]\n```\n\nThe resuling table output will outline which tables are in sync between the targets, and which are not:\n\n```\n$ ./pgverify \\\n\t\t--tests bookend,full,rowcount,sparse \\\n\t\t--include-tables testtable1,testtable2,testtable3 \\\n\t\t--aliases cockroachdb/cockroach:latest,cockroachdb/cockroach:v21.2.0,postgres:10,postgres:11,postgres:12.6 \\\n\t\tpostgres://root@crdb-latest:26257/testdb \\\n\t\tpostgres://root@crdb-21-2-0:26258/testdb \\\n\t\tpostgres://postgres@psql-10:5432/testdb \\\n\t\tpostgres://postgres@psql-11:5433/testdb \\\n\t\tpostgres://postgres@psql-12-6:5434/testdb\n+--------+------------+----------------------------------+----------------------------------+----------+----------------------------------+-------------------------------+\n| schema |   table    |             bookend              |               full               | rowcount |              sparse              |            target             |\n+--------+------------+----------------------------------+----------------------------------+----------+----------------------------------+-------------------------------+\n| public | testtable1 | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:latest  |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:v21.2.0 |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:10                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:11                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:12.6                 |\n|        | testtable2 | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:latest  |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:v21.2.0 |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:10                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:11                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:12.6                 |\n|        | testtable3 | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:latest  |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | cockroachdb/cockroach:v21.2.0 |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:10                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:11                   |\n|        |            | 354c0eedeecf8907a90dd98ed3d826d9 | bffe76957644e5755db2dd2f608bfdb3 |       50 | 454ce26f516555a103be83011b043dfd | postgres:12.6                 |\n+--------+------------+----------------------------------+----------------------------------+----------+----------------------------------+-------------------------------+\n```\n\nSee `pgverify --help` for flag configuration options.\n\n## Supported databases\n\n| Database Engine     | Supported Versions |\n| ------------------- | ------------------ |\n| [PostgreSQL][psql]  | `\u003e=10`             |\n| [CockroachDB][crdb] | `\u003e=21.2`           |\n\n## Test modes\n\n| Test mode  | Description                                                                                                 |\n| ---------- | ----------------------------------------------------------------------------------------------------------- |\n| `full`     | Generates an MD5 hash from *all* of the rows in a table. Memory intensive, but the highest confidence test. |\n| `bookend`  | Generates an MD5 hash from the first and last `X` rows in a table, configured by `--bookend-limit X`.       |\n| `sparse`   | Generates an MD5 hash from approximately `1/X` rows in a table, configured by `--sparse-mod X`.             |\n| `rowcount` | Simply queries and compares total row count for a table.                                                    |\n\n## Gotchas\n\n* Due to PostgreSQL and CockroachDB having slightly differing ways of sorting keys in a `jsonb` value, this tool uses `length(jsonb::text)` as a low-fidelity proxy fingerprint.\n\n\u003c!-- Links --\u003e\n[crdb]: https://www.cockroachlabs.com/\n[psql]: https://www.postgresql.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjfinnell%2Fpgverify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjfinnell%2Fpgverify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjfinnell%2Fpgverify/lists"}