[open-ils-commits] r12505 - trunk/Open-ILS/src/extras/import (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 12 22:19:47 EDT 2009
Author: miker
Date: 2009-03-12 22:19:45 -0400 (Thu, 12 Mar 2009)
New Revision: 12505
Modified:
trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl
Log:
teach parallel_pg_loader.pl to set the sequence on non-auto tables after loading data into them
Modified: trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl 2009-03-13 01:42:15 UTC (rev 12504)
+++ trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl 2009-03-13 02:19:45 UTC (rev 12505)
@@ -123,8 +123,16 @@
$count++;
}
+for my $hint (@order) {
+ next if (grep { $_ eq $hint} @auto);
+ next unless ($fieldcache{$hint}{sequence});
+ $main_out->print("SELECT setval('$fieldcache{$hint}{sequence}'::TEXT, (SELECT MAX($fieldcache{$hint}{pkey}) FROM $fieldcache{$hint}{table}), TRUE);\n\n");
+}
+
if (grep /^mfr$/, %out_files) {
$main_out->print("SELECT reporter.enable_materialized_simple_record_trigger();\n");
}
+
$main_out->print("COMMIT;\n\n") unless $nocommit;
$main_out->close;
+
More information about the open-ils-commits
mailing list