From af140307a025738767e740fea8da8d15e20fb983 Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@archive.org>
Date: Wed, 5 Aug 2020 13:10:56 -0700
Subject: grobid+pdftext missing catch-up commands

---
 sql/dump_unextracted_pdf_petabox.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 sql/dump_unextracted_pdf_petabox.sql

(limited to 'sql/dump_unextracted_pdf_petabox.sql')

diff --git a/sql/dump_unextracted_pdf_petabox.sql b/sql/dump_unextracted_pdf_petabox.sql
new file mode 100644
index 0000000..7db34fb
--- /dev/null
+++ b/sql/dump_unextracted_pdf_petabox.sql
@@ -0,0 +1,18 @@
+
+-- Run like:
+--   psql sandcrawler < dump_unextracted_pdf_petabox.sql
+
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
+COPY (
+  SELECT DISTINCT ON (petabox.sha1hex) row_to_json(petabox)
+  FROM grobid
+  LEFT JOIN petabox ON grobid.sha1hex = petabox.sha1hex
+  LEFT JOIN pdf_meta ON grobid.sha1hex = pdf_meta.sha1hex
+  WHERE petabox.sha1hex IS NOT NULL
+    AND pdf_meta.sha1hex IS NULL
+)
+TO '/grande/snapshots/dump_unextracted_pdf_petabox.2020-07-22.json'
+WITH NULL '';
+
+ROLLBACK;
-- 
cgit v1.2.3

