do not use TRUNCATE when refreshing reporter.materialized_simple_record
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Nov 2010 13:31:09 +0000 (13:31 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Nov 2010 13:31:09 +0000 (13:31 +0000)
Previous behavior would break Slony replication after doing a
bib load.  Since a deletion is slower than a truncate, if you're
not using Slony replication, you may prefer to truncate rmsr
prior to calling reporter.enable_materialized_simple_record_trigger.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_0@18681 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/reporter-schema.sql

index 3e429ae..e61b476 100644 (file)
@@ -256,7 +256,7 @@ $$ LANGUAGE plpgsql;
 
 CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
 
-    TRUNCATE TABLE reporter.materialized_simple_record;
+    DELETE FROM reporter.materialized_simple_record;
 
     INSERT INTO reporter.materialized_simple_record
         (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)