aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dump_reingest_bulk.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dump_reingest_bulk.sql')
-rw-r--r--sql/dump_reingest_bulk.sql8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/dump_reingest_bulk.sql b/sql/dump_reingest_bulk.sql
index 403fb20..698db7a 100644
--- a/sql/dump_reingest_bulk.sql
+++ b/sql/dump_reingest_bulk.sql
@@ -1,7 +1,11 @@
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
COPY (
SELECT row_to_json(ingest_request.*) FROM ingest_request
- LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url
+ LEFT JOIN ingest_file_result ON
+ ingest_file_result.base_url = ingest_request.base_url
+ AND ingest_file_result.ingest_type = ingest_request.ingest_type
WHERE
(ingest_request.ingest_type = 'pdf'
OR ingest_request.ingest_type = 'html')
@@ -23,3 +27,5 @@ COPY (
AND ingest_file_result.status != 'spn2-error:network-authentication-required'
AND ingest_file_result.status != 'spn2-error:unknown'
) TO '/srv/sandcrawler/tasks/reingest_bulk_current.rows.json';
+
+ROLLBACK;