73 lines
2.2 KiB
Plaintext

In this directory you'll find out some pgloader usage examples.
To use them, please first create a pgloader database, then for each example
the tables it needs, then issue the pgloader command:
$ createdb --encoding=utf-8 pgloader
$ cd examples
$ psql pgloader < simple/simple.sql
$ ../pgloader.py -Tvc examples/pgloader.conf simple
If you want to load data from all examples, create tables for all of them
first, then run pgloader without argument.
The provided examples are:
. simple
This dataset shows basic case, with trailing separator and data
reordering.
. errors
Same test, but with impossible dates. Should report some errors. If it
does not report errors, check you're not using psycopg 1.1.21.
Should report 3 errors out of 7 lines (4 updates).
. clob
This dataset shows some text large object importing to PostgreSQL text
datatype.
. cluttured
A dataset with newline escaped and multi-line input (without quoting)
Beware of data reordering, too.
. csv
A dataset with csv delimiter ',' and quoting '"'.
. partial
A dataset from which we only load some columns of the provided one.
. serial
In this dataset the id field is ommited, it's a serial which will be
automatically set by PostgreSQL while COPYing.
You can launch all those pgloader tests in one run, provided you created the
necessary tables:
$ for sql in */*sql; do psql pgloader < $sql; done
$ ../pgloader.py -Tc pgloader.conf
[...]
Table name | duration | size | updates | errors
====================================================================
clob | 0.041s | 32 kB | 7 | 0
cluttered | 0.037s | 32 kB | 6 | 0
csv | 0.019s | 16 kB | 6 | 0
errors | 0.032s | 32 kB | 4 | 3
partial | 0.024s | 32 kB | 7 | 0
serial | 0.028s | 32 kB | 7 | 0
simple | 0.029s | 32 kB | 7 | 0
====================================================================
Total | 0.210s | 208 kB | 44 | 3