pg_json_diff
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_json_diff | 1.0 | UTIL | MIT | C++ |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4160 | pg_json_diff | No | Yes | No | Yes | No | Yes | - |
Source requires PostgreSQL 12+ and C++17. Packaging removes the unsupported control-file author field; no extension dependency.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | pg_json_diff | - |
| RPM | PIGSTY | 1.0 | 1817161514 | pg_json_diff_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-pg-json-diff | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0 el8.x86_64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.0 el8.aarch64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.0 el9.x86_64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.0 el9.aarch64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.0 el10.x86_64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.0 el10.aarch64.pg18 : pg_json_diff_18 pg_json_diff_18-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg17 : pg_json_diff_17 pg_json_diff_17-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg16 : pg_json_diff_16 pg_json_diff_16-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg15 : pg_json_diff_15 pg_json_diff_15-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg14 : pg_json_diff_14 pg_json_diff_14-1.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.0 d12.x86_64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.0 d12.aarch64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.0 d13.x86_64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.0 d13.aarch64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.0 u22.x86_64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.0 u22.aarch64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.0 u24.x86_64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.0 u24.aarch64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.0 u26.x86_64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.0 u26.aarch64.pg18 : postgresql-18-pg-json-diff postgresql-18-pg-json-diff_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg17 : postgresql-17-pg-json-diff postgresql-17-pg-json-diff_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg16 : postgresql-16-pg-json-diff postgresql-16-pg-json-diff_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg15 : postgresql-15-pg-json-diff postgresql-15-pg-json-diff_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg14 : postgresql-14-pg-json-diff postgresql-14-pg-json-diff_1.0-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pg_json_diff using pig build:
Install
You can install pg_json_diff directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
pg_json_diff 1.0 provides three immutable JSONB transformation functions backed by nlohmann/json: generate an RFC 6902 JSON Patch, apply such a patch, or apply an RFC 7386 merge patch. Use it for explicit document transformations, not as automatic conflict resolution or a stable audit-diff format.
Core Workflow
Generate a patch, store or inspect it, and verify that applying it produces the expected target:
Validate externally supplied patches before applying them and run the transformation in a transaction with application-level authorization.
Function Index
generate_json_diff(source, target)returns an RFC 6902 operation array.apply_patch(document, patch)supports add, remove, replace, move, copy, and test operations.merge_patch(document, patch)recursively merges objects; a null member removes a key and arrays are replaced rather than merged.
All three functions accept and return jsonb.
Operational Notes
Each call serializes PostgreSQL JSONB to text, parses it into a C++ JSON value, performs the operation, serializes again, and reparses the result as JSONB. Large or deeply nested documents therefore incur copying and parser cost. nlohmann/json and PostgreSQL JSONB have different numeric models, so test very large integers and high-precision decimals for fidelity. Patch errors are surfaced as general internal errors, and generated operation order or paths should not be treated as a canonical human audit record.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)