Repository navigation
PG compatibility: reviewed witnesses and report generation (Tasks 7-8) #46
Copy link
Copy link
Closed
Description
Context
This issue tracks Tasks 7-8 from docs/superpowers/plans/2026-06-11-postgresql-libpg-query-compatibility.md and follows #51.
Task 7: reviewed witnesses and metadata validation
Implemented on PR #50 in commit 1f9122e test: add reviewed PostgreSQL syntax witnesses.
Added
tests/pg_compat/witnesses.sqltests/pg_compat/witnesses.jsontests/pg_compat/structural_dispositions.json
Updated
scripts/pg_compat/baseline.pytests/pg_compat/test_baseline.py
Behavior
- Parses witness SQL through a target
pg_compatrunner viaload_reviewed_witnesses(). - Validates metadata count against parsed SQL statement count.
- Rejects duplicate witness IDs.
- Rejects unsupported
first_postgresql_majorvalues above the target major. - Requires
structural_feature_idsto be present and a list of strings. - Rejects oracle node mismatches against
expected_oracle_node. - Reports empty feature links as
unlinked_witnessesfor later refresh review.
Seed witnesses
pg-json-object-constructor: SQL/JSON constructor through SELECT.pg-merge-statement: PostgreSQL MERGE statement currently surfaced by ParserSQL asTYPE_MISMATCH.
Task 8: Markdown compatibility reports
Implemented on PR #50 in commit 7663f51 feat: generate PostgreSQL compatibility reports.
Added
scripts/pg_compat/generate_report.pytests/pg_compat/test_generate_report.py
Report content
- PostgreSQL target-version header.
- Generation timestamp.
- ParserSQL commit.
- Previous and target
libpg_querybranches, SHAs, and PostgreSQL patch versions. - Result totals for all six compatibility outcomes.
- PG18 backlog excluding
DEEP_SUPPORTED. CLASSIFIED_ONLYrouting coverage.- PG17-to-PG18 release delta outcomes.
- Newly supported and regressed baseline transitions.
- Structural feature witness links.
- Unwitnessed structural features.
- Unlinked witnesses.
- Reproduction commands.
Determinism
- Statement rows sort by result, oracle node, and statement ID.
- Structural feature rows sort by kind, symbol, and feature ID.
- SQL shown in Markdown is normalized and limited to 200 characters; complete SQL remains in JSONL inputs.
Verification
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests/pg_compat -p "test_baseline.py" -v: 13 tests passed.- Actual PG18 runner accepted both seed witnesses; SQL/JSON was
DEEP_SUPPORTED, MERGE wasTYPE_MISMATCH. PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests/pg_compat -p "test_generate_report.py" -v: 2 tests passed.PYTHONDONTWRITEBYTECODE=1 PG_COMPAT_RUNNER=/tmp/parsersql-pg-compat-test/bin/pg_compat-18 python3 -m unittest discover -s tests/pg_compat -p "test_*.py" -v: 79 tests passed.
Status
Implementation is complete on PR #50. The issue will close when that PR merges.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
renecannao commentedon Jun 15, 2026
Tasks 7 and 8 are implemented and pushed to PR #50. Commits:
1f9122efor reviewed witnesses and7663f51for Markdown reports. Local verification passed: 13 focused baseline tests, 2 report tests, and 79 full pg_compat tests with the PG18 runner. Fresh PR CI is running.renecannao commentedon Jun 15, 2026
Fresh CI for Tasks 7-8 head commit
7663f51completed successfully: 8 checks passed, with 0 failing, 0 cancelled, and 0 pending.