/[pgdiff]/pgdiff
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /pgdiff

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by dpavlin, Sun Oct 26 19:22:36 2003 UTC revision 1.13 by dpavlin, Fri Oct 31 11:19:45 2003 UTC
# Line 132  debug "Comparing tables: ".join(", ",@ta Line 132  debug "Comparing tables: ".join(", ",@ta
132  print "begin work;\n";  print "begin work;\n";
133    
134  # disable active triggers on slave database  # disable active triggers on slave database
135  my @triggers = $sscheme->get_triggers();  my @triggers = $sscheme->get_activetriggers();
136    
137  foreach my $tr (@triggers) {  foreach my $tr (@triggers) {
138          print "update pg_trigger set tgenabled = false where tgname='$tr';\n";          print "update pg_trigger set tgenabled = false where tgname='$tr';\n";
# Line 145  foreach my $table (@tables) { Line 145  foreach my $table (@tables) {
145    
146          my $sth;          my $sth;
147    
148    print "-- schema...\n";
149          # diff schema          # diff schema
150            foreach my $row (@{$mscheme->pg_attribute($table)}) {
151    #               print Dumper($row);
152            }
153    
154    print "-- constraints...\n";
155            # diff constraints
156            foreach my $tr (@{$mscheme->triggers($table)}) {
157    #               print Dumper($tr);
158            }
159    print "-- triggers...\n";
160            # diff triggers
161            foreach my $tr (@{$mscheme->triggers($table)}) {
162    #               print Dumper($tr);
163            }
164    
165          # all colums (for insert)          # all columns (for insert)
166          my @cols = @{$mscheme->cols($table)};          my @cols = @{$mscheme->cols($table)};
167    
168          # colums compared by a=b          # columns compared by a=b
169          my @cols_notnull = @{$mscheme->cols_notnull($table)};          my @cols_notnull = @{$mscheme->cols_notnull($table)};
170    
171          # 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
172          my @cols_null = @{$mscheme->cols_null($table)};          my @cols_null = @{$mscheme->cols_null($table)};
173    
174          # primary key columns          # primary key columns
# Line 163  foreach my $table (@tables) { Line 178  foreach my $table (@tables) {
178          my @cols_cmp = @{$mscheme->cols_notpk($table)};          my @cols_cmp = @{$mscheme->cols_notpk($table)};
179    
180          my @cols_skip;  # skipped columns          my @cols_skip;  # skipped columns
181          my @cols_test;  # all colums to test (without skipped)          my @cols_test;  # all columns to test (without skipped)
182    
183          foreach my $row (@{$mscheme->pg_attribute($table)}) {          foreach my $row (@{$mscheme->pg_attribute($table)}) {
184                  # attname | format_type | attnotnull | atthasdef | attnum                  # attname format_type attnotnull atthasdef attnum default references
185    
186                  # FIXME: do something with attributes which shouldn't be compared                  # FIXME: do something with attributes which shouldn't be compared
187                  # (date, time, datetime, timestamp)                  # (date, time, datetime, timestamp)
# Line 392  foreach my $table (@tables) { Line 407  foreach my $table (@tables) {
407    
408  if ($verbose) {  if ($verbose) {
409          if ($diff_total == 0) {          if ($diff_total == 0) {
410                  print STDERR "databases are same";                  print STDERR "databases are same\n";
411          } elsif ($diff_total > 0) {          } elsif ($diff_total > 0) {
412                  print STDERR "$diff_total differences in all tables\n";                  print STDERR "$diff_total differences in all tables\n";
413          } else {          } else {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26