pgloader/examples
2007-06-04 12:14:18 +00:00
..
clob New version of pgloader (2.0.2): 2006-11-19 21:18:42 +00:00
cluttered New version of pgloader (2.0.2): 2006-11-19 21:18:42 +00:00
csv CSV support, can load not-all-columns of data files, can load to table with more cols than data file 2007-06-04 12:14:18 +00:00
errors New version of pgloader (2.0.2): 2006-11-19 21:18:42 +00:00
partial CSV support, can load not-all-columns of data files, can load to table with more cols than data file 2007-06-04 12:14:18 +00:00
serial Support partial columns definition for COPY 2007-01-19 11:30:09 +00:00
simple New version of pgloader (2.0.2): 2006-11-19 21:18:42 +00:00
pgloader.conf CSV support, can load not-all-columns of data files, can load to table with more cols than data file 2007-06-04 12:14:18 +00:00
README CSV support, can load not-all-columns of data files, can load to table with more cols than data file 2007-06-04 12:14:18 +00:00

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