From 8595342b1153b7d562fb2d3f5a775e80b9c8d030 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 18 Sep 2009 17:23:00 +0000 Subject: [PATCH] Bug reported by Wiktor Rzeczkowski from McMaster University: [parallel_]pg_loader.pl was not taught about the changes to the materialized_simple_record trigger 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 | 4 +--- Open-ILS/src/extras/import/pg_loader.pl | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/extras/import/parallel_pg_loader.pl b/Open-ILS/src/extras/import/parallel_pg_loader.pl index fa49ac319..3cc8fd6b3 100755 --- a/Open-ILS/src/extras/import/parallel_pg_loader.pl +++ b/Open-ILS/src/extras/import/parallel_pg_loader.pl @@ -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; diff --git a/Open-ILS/src/extras/import/pg_loader.pl b/Open-ILS/src/extras/import/pg_loader.pl index ea365619b..611bb747b 100755 --- a/Open-ILS/src/extras/import/pg_loader.pl +++ b/Open-ILS/src/extras/import/pg_loader.pl @@ -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") -- 2.11.0