apgdiff icon indicating copy to clipboard operation
apgdiff copied to clipboard

Can't parse comments of columns containing an undesrcore

Open GTonehour opened this issue 4 months ago • 0 comments

https://github.com/fordfrog/apgdiff/issues/159 was marked completed six years ago so this may be a different issue: apgdiff-2.4 fails to parse my SQL file pg_dump export in PG 17. I can reproduce with this one-line sql script:

COMMENT ON COLUMN schema.table.column_with_underscore IS 'a';

Fails with:

Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: COMMENT ON COLUMN app.article.article_rankinarticletype IS '"Generating always" would prevent it from being used in article_code. And "DEFAULT" cannot access other columns like article_type. So we have to rely on using the sequence corresponding to the articletype (like article_c0_seq) at insert time.';
Expected IS at position 30 '.article_rankinartic'
        at cz.startnet.utils.pgdiff.parsers.Parser.expect(Parser.java:86)
        at cz.startnet.utils.pgdiff.parsers.Parser.expect(Parser.java:47)
        at cz.startnet.utils.pgdiff.parsers.CommentParser.parseColumn(CommentParser.java:255)
        at cz.startnet.utils.pgdiff.parsers.CommentParser.parse(CommentParser.java:42)
        at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:200)
        at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:236)
        at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:29)
        at cz.startnet.utils.pgdiff.Main.main(Main.java:39)

GTonehour avatar Dec 30 '25 14:12 GTonehour