Failing SQL Feature:
COMMENT ON <object> IS NULL cannot be parsed. In PostgreSQL, writing NULL in place of the text string is the way to remove a comment — per the COMMENT docs: "To remove a comment, write NULL in place of the text string." So a DDL stream that drops comments cannot be processed.
SQL Example:
COMMENT ON TABLE app.t IS NULL
fails on 5.3 and on current master (6c726d8) with:
net.sf.jsqlparser.parser.ParseException: Encountered: <K_NULL> / "NULL", at line 1, column 27, in lexical state DEFAULT.
Was expecting this terminal within expansion starting at 15161:20:
<S_CHAR_LITERAL> ...
COMMENT ON COLUMN app.t.name IS NULL and COMMENT ON VIEW app.v IS NULL fail the same way. All string-literal forms parse fine, including the empty string (IS 'hello', IS '').
Software Information:
- JSqlParser 5.3 (current Maven Central release); reproduced on master 6c726d8
- PostgreSQL 18 (verified:
COMMENT ON TABLE t IS NULL removes the comment, i.e. deletes the pg_description row; IS '' behaves the same)
I'll follow up with a PR (grammar + round-trip tests).
Failing SQL Feature:
COMMENT ON <object> IS NULLcannot be parsed. In PostgreSQL, writingNULLin place of the text string is the way to remove a comment — per theCOMMENTdocs: "To remove a comment, write NULL in place of the text string." So a DDL stream that drops comments cannot be processed.SQL Example:
fails on 5.3 and on current master (6c726d8) with:
COMMENT ON COLUMN app.t.name IS NULLandCOMMENT ON VIEW app.v IS NULLfail the same way. All string-literal forms parse fine, including the empty string (IS 'hello',IS '').Software Information:
COMMENT ON TABLE t IS NULLremoves the comment, i.e. deletes thepg_descriptionrow;IS ''behaves the same)I'll follow up with a PR (grammar + round-trip tests).