I need dump database into 2 sql files : ddl script and dml script.
I used pgadmin's gui, clicked on backup and check only Only schema
option to create ddl. Next I did same operation, but I clicked Only data
to create dml.
Problem is with insert orders and import crashed on FK constraint.
For instance I have table Foo(id, foo_parent_id, ...) and insert are in this order:
insert into foo values(1, 3);
insert into foo values(2, 3);
insert into foo values(3, null);
during file execution it crashed on first insert because parent with id 3 not exists. Is possible solve it? I executed these files in docker postgres container. Thank you.