aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-10-01 19:51:28 -0700
committerBryan Newbold <bnewbold@archive.org>2020-10-01 19:51:28 -0700
commit302489c3691c5d4285d1d62fdb99ef05d5f79acf (patch)
tree16ea717748294a8f9c2645ec28e24d49fc5ad6db
parentccc181355d4bf54e9c0018ccc440e302763697cb (diff)
downloadsandcrawler-302489c3691c5d4285d1d62fdb99ef05d5f79acf.tar.gz
sandcrawler-302489c3691c5d4285d1d62fdb99ef05d5f79acf.zip
dump_file_meta helper
-rw-r--r--sql/dump_file_meta.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/dump_file_meta.sql b/sql/dump_file_meta.sql
new file mode 100644
index 0000000..1028c13
--- /dev/null
+++ b/sql/dump_file_meta.sql
@@ -0,0 +1,12 @@
+
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
+COPY (
+ SELECT sha1hex, row_to_json(file_meta)
+ FROM file_meta
+ ORDER BY sha1hex ASC
+)
+TO '/grande/snapshots/file_meta_dump.tsv'
+WITH NULL '';
+
+ROLLBACK;