We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d084d3 commit d8b8235Copy full SHA for d8b8235
src/tasks/dump_db/dump-export.sql.hbs
@@ -1,19 +1,11 @@
1
-BEGIN;
+BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
2
{{~#each tables}}
3
{{~#if this.filter}}
4
- CREATE TEMPORARY VIEW "dump_db_{{this.name}}" AS (
+ \copy (
5
SELECT {{this.columns}}
6
FROM "{{this.name}}"
7
WHERE {{this.filter}}
8
- );
9
-{{~/if}}
10
-{{~/each}}
11
-COMMIT;
12
-
13
-BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
14
-{{~#each tables}}
15
-{{~#if this.filter}}
16
- \copy (SELECT * FROM "dump_db_{{this.name}}") TO 'data/{{this.name}}.csv' WITH CSV HEADER
+ ) TO 'data/{{this.name}}.csv' WITH CSV HEADER
17
{{~else}}
18
\copy "{{this.name}}" ({{this.columns}}) TO 'data/{{this.name}}.csv' WITH CSV HEADER
19
{{~/if}}
0 commit comments