Hi,
Hoping to be 'lucky' here.
Anyone aware of any shell script/s that can list all tables / indexes / constraints for 2 DBs and compare them for any differences? I am only wanting to compare the structure, not the data.
Found some from browsing around, pgcmp, pgdiff, but the problem is I am not allowed to install stuff on the server. The DB version, 11.7, is really old too so not sure whether these ones I found will work.
There is also one that uses pgdump and pg_restore -l to do the comparison.
I am looking at something like below:
- connect to db01 and db02
- \dt - select from pg_tables for list of tables and output each table to a file of their own
- \di - select from pg_indexes for list of indexes and output each index to a file of their own
- doesn't there is a \ version for constraints but I think I can do select from pg_constraints for list of constraints and output each constraint to a file of their own
- compare/diff the file content of each file
- will start with just the tables for now
Regards,
Ed