aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dump_unextracted_pdf_petabox.sql
blob: bb9f1623f8ec30f2f4f9bfdcd1bc86260431356d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 '/srv/sandcrawler/tasks/dump_unextracted_pdf_petabox.2020-07-22.json'
WITH NULL '';

ROLLBACK;