fordfrog / apgdiff

Another PostgreSQL Diff Tool
http://www.apgdiff.com
MIT License
355 stars 138 forks source link

Cannot parse string: ALTER TABLE ONLY public.mytable_partitionned ATTACH PARTITION public.mytable_2013_t1 FOR VALUES IN (...) #291

Open maltebrun opened 2 years ago

maltebrun commented 2 years ago

Hello, I'm trying to use apgdiff v2.7.0 to compare 2 dumps generated with pg_dump from PostgreSQL 10.

One of the tables is partitionned by values.

apgdiff throw this exception :

Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: ALTER TABLE ONLY public.mytable_partitionned ATTACH PARTITION public.mytable_2013_t1 FOR VALUES IN ('2013-01', '2013-02', '2013-03');
Unsupported command at position 51 'ATTACH PARTITION pub'
at cz.startnet.utils.pgdiff.parsers.Parser.throwUnsupportedCommand(Parser.java:413)
at cz.startnet.utils.pgdiff.parsers.AlterRelationParser.parse(AlterRelationParser.java:119)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:248)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:322)
at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:35)
at cz.startnet.utils.pgdiff.Main.main(Main.java:39)

Seems to be similar to gintaraskuc comment on 26 Nov 2021

Any help would by appreciated.

kamal140415 commented 2 years ago

@maltebrun I am also getting same issue. Did you find any solution for this issue? Please suggest

melaniemarc commented 2 years ago

same for me, any solution ?

alci63 commented 2 years ago

Same problem. I used sed -i /ATTACH PARTITION/d' myname.sql to get rid of these lines, but of course this is not great...