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
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,26 @@ make build-sqlengine # Interactive SQL CLI
64
64
make build-corpus-test # Corpus validation harness
65
65
```
66
66
67
+
### PostgreSQL compatibility harness
68
+
69
+
ParserSQL uses `libpg_query` as the PostgreSQL syntax oracle for compatibility checks. The harness pins `libpg_query``17-latest` and `18-latest`, extracts accepted PostgreSQL regression statements, and compares ParserSQL behavior against the committed PostgreSQL 18 baseline in [`docs/compatibility/postgresql-18.md`](docs/compatibility/postgresql-18.md).
70
+
71
+
Compatibility results separate full parser parity from classification coverage:
72
+
73
+
-`DEEP_SUPPORTED` means ParserSQL accepted the statement with the expected statement type and a full AST.
74
+
-`CLASSIFIED_ONLY` means ParserSQL recognized the top-level statement class, but did not produce full deep parser parity for that SQL.
75
+
-`PARTIAL`, `ERROR`, `TRAILING_INPUT`, and `TYPE_MISMATCH` are tracked separately in the committed baseline.
76
+
77
+
The report includes the full PostgreSQL 18 backlog, the PG17-to-PG18 release delta, statement routing coverage, and reviewed structural grammar/keyword changes.
78
+
79
+
```bash
80
+
make test-pg-compat # Build the pinned oracle runner, run harness unit tests, and replay committed CI cases
81
+
make pg-compat # Run the full pinned PG17/PG18 comparison against the committed baseline
82
+
make pg-compat-refresh # Regenerate expected_results.jsonl, ci_cases.jsonl, and docs/compatibility/postgresql-18.md
83
+
```
84
+
85
+
`PG_COMPAT_CACHE` controls where external `libpg_query` and PostgreSQL source checkouts are cached. It defaults to `/tmp/parsersql-pg-compat`.
@@ -76,6 +79,44 @@ ls -la third_party/libpg_query/libpg_query.a
76
79
77
80
---
78
81
82
+
## PostgreSQL Compatibility Harness
83
+
84
+
The PostgreSQL compatibility harness uses pinned `libpg_query` builds as the syntax oracle. It compares ParserSQL against PostgreSQL 17 and PostgreSQL 18 regression SQL, writes a committed PostgreSQL 18 baseline, and reports the PG17-to-PG18 syntax delta in `docs/compatibility/postgresql-18.md`.
85
+
86
+
Required external tools:
87
+
88
+
```text
89
+
git
90
+
curl
91
+
tar with bzip2 support
92
+
python3
93
+
C/C++ compiler
94
+
make
95
+
```
96
+
97
+
`PG_COMPAT_CACHE` controls where external sources and built oracle runners are cached. It defaults to `/tmp/parsersql-pg-compat`.
98
+
99
+
```bash
100
+
# Fast deterministic gate: unit tests plus committed CI cases
101
+
make test-pg-compat
102
+
103
+
# Full pinned PG17/PG18 comparison against committed expected_results.jsonl
104
+
make pg-compat
105
+
106
+
# Refresh committed artifacts after intentionally updating pins or mappings
107
+
make pg-compat-refresh
108
+
```
109
+
110
+
The harness result model distinguishes parser depth from statement routing:
111
+
112
+
-`DEEP_SUPPORTED` means ParserSQL accepted the SQL with the expected statement type and a full AST.
113
+
-`CLASSIFIED_ONLY` means ParserSQL recognized the top-level statement class, but did not reach full parser parity for that SQL.
114
+
-`PARTIAL`, `ERROR`, `TRAILING_INPUT`, and `TYPE_MISMATCH` are committed baseline outcomes that must not regress silently.
115
+
116
+
The refresh target updates `tests/pg_compat/expected_results.jsonl`, `tests/pg_compat/ci_cases.jsonl`, and `docs/compatibility/postgresql-18.md`.
0 commit comments