my $fields = join(',', @{ $fieldcache{$hint}{fields} });
$main_out->print( "DELETE FROM $fieldcache{$hint}{table};\n" ) if (grep {$_ eq $hint } @wipe);
# Speed up loading of bib records
- if ($hint eq 'mfr') {
- $main_out->print("\nSELECT reporter.disable_materialized_simple_record_trigger();\n");
- }
$main_out->print( "COPY $fieldcache{$hint}{table} ($fields) FROM '$pwd/$output.$hint.sql';\n" );
}
if (grep /^mfr$/, %out_files) {
$main_out->print("SELECT reporter.enable_materialized_simple_record_trigger();\n");
+ $main_out->print("SELECT reporter.disable_materialized_simple_record_trigger();\n");
}
$main_out->print("COMMIT;\n\n") unless $nocommit;
my $fields = join(',', @{ $fieldcache{$h}{fields} });
$output->print( "DELETE FROM $fieldcache{$h}{table};\n" ) if (grep {$_ eq $h } @wipe);
# Speed up loading of bib records
- if ($h eq 'mfr') {
- $output->print("\nSELECT reporter.disable_materialized_simple_record_trigger();\n");
- }
$output->print( "COPY $fieldcache{$h}{table} ($fields) FROM STDIN;\n" );
for my $line (@{ $lineset{$h} }) {
if ($h eq 'mfr') {
$output->print("SELECT reporter.enable_materialized_simple_record_trigger();\n");
+ $output->print("SELECT reporter.disable_materialized_simple_record_trigger();\n");
}
$output->print("SELECT setval('$fieldcache{$h}{sequence}'::TEXT, (SELECT MAX($fieldcache{$h}{pkey}) FROM $fieldcache{$h}{table}), TRUE);\n\n")