File tree Expand file tree Collapse file tree 16 files changed +252
-202
lines changed Expand file tree Collapse file tree 16 files changed +252
-202
lines changed Original file line number Diff line number Diff line change 9292#
9393# html_theme_options = {}
9494html_theme_options = {
95- 'github_user' : 'dimitri' ,
96- 'github_repo' : 'pgloader' ,
97- 'description' : 'your migration companion' ,
98- 'travis_button' : True ,
99- 'show_related' : True ,
95+ # 'github_user': 'dimitri',
96+ # 'github_repo': 'pgloader',
97+ # 'description': 'your migration companion',
98+ # 'travis_button': True,
99+ # 'show_related': True,
100100 #'sidebar_collapse': False,
101101}
102102
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -455,6 +455,8 @@ pgloader templating system::
455455The mustache templates implementation with OS environment support replaces
456456former `GETENV ` implementation, which didn't work anyway.
457457
458+ .. _common_clauses :
459+
458460Common Clauses
459461--------------
460462
Original file line number Diff line number Diff line change @@ -5,7 +5,19 @@ This command instructs pgloader to load data from one or more files contained
55in an archive. Currently the only supported archive format is *ZIP *, and the
66archive might be downloaded from an *HTTP * URL.
77
8- Here's an example::
8+ Using advanced options and a load command file
9+ ----------------------------------------------
10+
11+ The command then would be:
12+
13+ ::
14+
15+ $ pgloader archive.load
16+
17+ And the contents of the ``archive.load `` file could be inspired from the
18+ following:
19+
20+ ::
921
1022 LOAD ARCHIVE
1123 FROM /Users/dim/Downloads/GeoLiteCity-latest.zip
@@ -61,7 +73,11 @@ Here's an example::
6173 FINALLY DO
6274 $$ create index blocks_ip4r_idx on geolite.blocks using gist(iprange); $$;
6375
64- The `archive ` command accepts the following clauses and options.
76+ Common Clauses
77+ --------------
78+
79+ Please refer to :ref: `common_clauses ` for documentation about common
80+ clauses.
6581
6682Archive Source Specification: FROM
6783----------------------------------
Original file line number Diff line number Diff line change @@ -2,7 +2,20 @@ Loading COPY Formatted Files
22============================
33
44This commands instructs pgloader to load from a file containing COPY TEXT
5- data as described in the PostgreSQL documentation. Here's an example::
5+ data as described in the PostgreSQL documentation.
6+
7+ Using advanced options and a load command file
8+ ----------------------------------------------
9+
10+ The command then would be:
11+
12+ ::
13+
14+ $ pgloader copy.load
15+
16+ And the contents of the ``copy.load `` file could be inspired from the following:
17+
18+ ::
619
720 LOAD COPY
821 FROM copy://./data/track.copy
@@ -33,7 +46,12 @@ data as described in the PostgreSQL documentation. Here's an example::
3346 );
3447 $$;
3548
36- The `COPY ` format command accepts the following clauses and options.
49+
50+ Common Clauses
51+ --------------
52+
53+ Please refer to :ref: `common_clauses ` for documentation about common
54+ clauses.
3755
3856COPY Formatted Files Source Specification: FROM
3957-----------------------------------------------
Original file line number Diff line number Diff line change 11Loading CSV data
22================
33
4- This command instructs pgloader to load data from a `CSV ` file. Here's an
5- example::
4+ This command instructs pgloader to load data from a `CSV ` file. Because of
5+ the complexity of guessing the parameters of a CSV file, it's simpler to
6+ instruct pgloader with how to parse the data in there, using the full
7+ pgloader command syntax and CSV specifications as in the following example.
8+
9+ Using advanced options and a load command file
10+ ----------------------------------------------
11+
12+ The command then would be:
13+
14+ ::
15+
16+ $ pgloader csv.load
17+
18+ And the contents of the ``csv.load `` file could be inspired from the following:
19+
20+ ::
621
722 LOAD CSV
823 FROM 'GeoLiteCity-Blocks.csv' WITH ENCODING iso-646-us
@@ -25,7 +40,11 @@ example::
2540
2641 SET work_mem to '32 MB', maintenance_work_mem to '64 MB';
2742
28- The `csv ` format command accepts the following clauses and options.
43+ Common Clauses
44+ --------------
45+
46+ Please refer to :ref: `common_clauses ` for documentation about common
47+ clauses.
2948
3049CSV Source Specification: FROM
3150------------------------------
Original file line number Diff line number Diff line change @@ -5,17 +5,33 @@ This command instructs pgloader to load data from a `DBF` file. A default
55set of casting rules are provided and might be overloaded and appended to by
66the command.
77
8+ Using advanced options and a load command file
9+ ----------------------------------------------
10+
811Here's an example with a remote HTTP source and some user defined casting
9- rules::
12+ rules. The command then would be:
13+
14+ ::
15+
16+ $ pgloader dbf.load
17+
18+ And the contents of the ``dbf.load `` file could be inspired from the following:
19+
20+ ::
1021
1122 LOAD DBF
12- FROM http://www.insee.fr/fr/methodes/nomenclatures/cog/telechargement/2013/dbf/reg2013.dbf
23+ FROM http://www.insee.fr/fr/methodes/nomenclatures/cog/telechargement/2013/dbf/reg2013.dbf
1324 INTO postgresql://user@localhost/dbname
1425 WITH truncate, create table
1526 CAST column reg2013.region to integer,
1627 column reg2013.tncc to smallint;
1728
18- The `dbf ` format command accepts the following clauses and options.
29+
30+ Common Clauses
31+ --------------
32+
33+ Please refer to :ref: `common_clauses ` for documentation about common
34+ clauses.
1935
2036DBF Source Specification: FROM
2137------------------------------
Original file line number Diff line number Diff line change @@ -2,7 +2,20 @@ Loading Fixed Cols File Formats
22===============================
33
44This command instructs pgloader to load data from a text file containing
5- columns arranged in a *fixed size * manner. Here's an example::
5+ columns arranged in a *fixed size * manner.
6+
7+ Using advanced options and a load command file
8+ ----------------------------------------------
9+
10+ The command then would be:
11+
12+ ::
13+
14+ $ pgloader fixed.load
15+
16+ And the contents of the ``fixed.load `` file could be inspired from the following:
17+
18+ ::
619
720 LOAD FIXED
821 FROM inline
@@ -41,7 +54,16 @@ columns arranged in a *fixed size* manner. Here's an example::
4154 2345609872014092914371500
4255 2345678902014092914371520
4356
44- The `fixed ` format command accepts the following clauses and options.
57+ Note that the example comes from the test suite of pgloader, where we use
58+ the advanced feature ``FROM inline `` that allows embedding the source data
59+ within the command file. In most cases a more classic FROM clause loading
60+ the data from a separate file would be used.
61+
62+ Common Clauses
63+ --------------
64+
65+ Please refer to :ref: `common_clauses ` for documentation about common
66+ clauses.
4567
4668Fixed File Format Source Specification: FROM
4769--------------------------------------------
You can’t perform that action at this time.
0 commit comments