taozhi8833998 / taozhi8833998/node-sql-parser
Parser fails to astify postgres query containing IS DISTINCT FROM TRUE in WHERE clause
Open
@taozhi8833998 is already working on this.
Since May 27, 2026.
- Dominant language
- PEG.js
- Stars
- 1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
As title says, the node-sql-parser fails when trying to astify a postgres query containing IS DISTINCT FROM TRUE in WHERE clause.
Database Engine
PostgreSQL
To Reproduce
Query:
SELECT * FROM my_table a WHERE a.value IS DISTINCT FROM TRUE
node-sql-parser version: 5.4.0
node version: 22.18.0
Expected behavior
astify should succeed; the query is valid, instead the error below is thrown.
Screenshots
Error message and stack trace:
Error running fn s68 [SyntaxError]: Expected [A-Za-z0-9_\-$一-龥À-ſ] but end of input found.
at Jl2 (/.../dist/index.js)
at Object.parse [as postgresql] (/.../dist/index.js)
at r49.value (/.../dist/index.js)
at r49.value (/.../dist/index.js)
... {
expected: [
{
type: 'class',
parts: [Array],
inverted: false,
ignoreCase: false
}
],
found: null,
location: {
start: { offset: 60, line: 1, column: 61 },
end: { offset: 60, line: 1, column: 61 }
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.