Closed lben closed 5 years ago
it is supported: http://apgdiff.com/supported_features.php#COMMENT
i guess the problem is only in the fact that you have I'm having same issue. My reference db (which has multiple schemas) was exported using http://apgdiff.com/how_to_use_it.php, same for the the target db. So the syntax use should be valid PostgreSQL, yet the error still occurs. I had the same issue:
I think that postgresql has change the way it generate the dump. Now it doesn't use search_path anymore. Postgres changed the way that search path semantics are used in pg_dump in response to this:
https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058:_Protect_Your_Search_Path The affect took place earlier this year (March 2018) and affects all supported versions of postgres/pg_dump. This affects all users of apgdiff, so it would be good to see a fix to address it. I can confirm the bug. Confirmed, as well..
Cannot parse string: COMMENT ON COLUMN public.country_subdivision.create_date IS 'Create Date'; Expected IS at position 45 '.create_date IS 'Cre'
Oddly enough it seems that apgdiff has no problem with table comments, in fact preceding line "COMMENT ON TABLE public.country_subdivision IS 'Subdivision';" did not trigger any error.
I solved commenting the COMMENT ON COLUMN lines (almost a joke) into dump files. In my case I use a bash script to perform dumping and comparing so in this script, after creating the two dump files and before calling apgdiff I used sed :
sed -i 's/COMMENT ON COLUMN/--COMMENT ON COLUMN/' $file_dev
sed -i 's/COMMENT ON COLUMN/--COMMENT ON COLUMN/' $file_prod
I guess this disables column comments syncing between dbs but I can bear that
I am trying to get a diff from a schema I have and I get the next error:
Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: COMMENT ON COLUMN public.abonado.estado IS '1=activo / 2=suspendido / 3=suspendido y retirado / 0=eliminado'; Expected IS at position 33 '.estado IS '1=activo' 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)
Can you add support for COMMENTS or how can I help you? I am a Java developer anyway.