Comparing Greenplum schema

Post date: Oct 17, 2013 2:42:28 PM

Compare 2 schemas in Greenplum to identify the differences in the table/view definitions. You can easily compare ANSI table information_schema.columns for both environments like this:

psql -h <host1> -c "copy (select * from information_schema.columns where table_schema=<your_schema> order by 1,2,3,5) to stdout with delimiter '|';" > schema1.log

psql -h <host2> -c "copy (select * from information_schema.columns where table_schema=<your_schema> order by 1,2,3,5) to stdout with delimiter '|';" > schema2.log

diff -ibwb schema1.log schema2.log