--- pgdiff 2003/10/26 19:22:36 1.10 +++ pgdiff 2003/10/31 11:19:45 1.13 @@ -132,7 +132,7 @@ print "begin work;\n"; # disable active triggers on slave database -my @triggers = $sscheme->get_triggers(); +my @triggers = $sscheme->get_activetriggers(); foreach my $tr (@triggers) { print "update pg_trigger set tgenabled = false where tgname='$tr';\n"; @@ -145,15 +145,30 @@ my $sth; +print "-- schema...\n"; # diff schema + foreach my $row (@{$mscheme->pg_attribute($table)}) { +# print Dumper($row); + } + +print "-- constraints...\n"; + # diff constraints + foreach my $tr (@{$mscheme->triggers($table)}) { +# print Dumper($tr); + } +print "-- triggers...\n"; + # diff triggers + foreach my $tr (@{$mscheme->triggers($table)}) { +# print Dumper($tr); + } - # all colums (for insert) + # all columns (for insert) my @cols = @{$mscheme->cols($table)}; - # colums compared by a=b + # columns compared by a=b my @cols_notnull = @{$mscheme->cols_notnull($table)}; - # colums compared by a=b or a is null and b is null + # columns compared by a=b or a is null and b is null my @cols_null = @{$mscheme->cols_null($table)}; # primary key columns @@ -163,10 +178,10 @@ my @cols_cmp = @{$mscheme->cols_notpk($table)}; my @cols_skip; # skipped columns - my @cols_test; # all colums to test (without skipped) + my @cols_test; # all columns to test (without skipped) foreach my $row (@{$mscheme->pg_attribute($table)}) { - # attname | format_type | attnotnull | atthasdef | attnum + # attname format_type attnotnull atthasdef attnum default references # FIXME: do something with attributes which shouldn't be compared # (date, time, datetime, timestamp) @@ -392,7 +407,7 @@ if ($verbose) { if ($diff_total == 0) { - print STDERR "databases are same"; + print STDERR "databases are same\n"; } elsif ($diff_total > 0) { print STDERR "$diff_total differences in all tables\n"; } else {