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"; |
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 colums (for insert) |
166 |
my @cols = @{$mscheme->cols($table)}; |
my @cols = @{$mscheme->cols($table)}; |
181 |
my @cols_test; # all colums to test (without skipped) |
my @cols_test; # all colums 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) |