Skip to content

Can't parse comments of columns containing an undesrcore #304

Description

@GTonehour

#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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions