Bug reported by Wiktor Rzeczkowski from McMaster University: [parallel_]pg_loader...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Sep 2009 17:23:00 +0000 (17:23 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Sep 2009 17:23:00 +0000 (17:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14048 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/import/parallel_pg_loader.pl
Open-ILS/src/extras/import/pg_loader.pl

index fa49ac3..3cc8fd6 100755 (executable)
@@ -88,9 +88,6 @@ while ( my $rec = <> ) {
                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" );
 
        }
@@ -131,6 +128,7 @@ for my $hint (@order) {
 
 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;
index ea36561..611bb74 100755 (executable)
@@ -94,9 +94,6 @@ for my $h (@order) {
        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} }) {
@@ -125,6 +122,7 @@ for my $h (@order) {
        
        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")