pgloader/examples
2008-02-25 14:21:53 +00:00
..
allcols Adding support for columns=* configuration 2008-02-25 14:21:53 +00:00
clob debian packaging 2007-11-29 21:30:25 +00:00
cluttered debian packaging 2007-11-29 21:30:25 +00:00
csv debian packaging 2007-11-29 21:30:25 +00:00
errors debian packaging 2007-11-29 21:30:25 +00:00
parallel First implementation of Round Robin Reader threading method, Work In Progress --- does not work at all yet 2008-02-12 21:58:42 +00:00
partial debian packaging 2007-11-29 21:30:25 +00:00
reformat debian packaging 2007-11-29 21:30:25 +00:00
serial debian packaging 2007-11-29 21:30:25 +00:00
simple debian packaging 2007-11-29 21:30:25 +00:00
udc Split file reading works with text format (problem was file iterator buffering) 2008-02-14 17:17:55 +00:00
parallel.conf FIX round-robin reader case when not all configured threads are needed to load the file 2008-02-16 19:17:03 +00:00
pgloader.conf Adding support for columns=* configuration 2008-02-25 14:21:53 +00:00
README DEBUG and documentation of reformat option, plus other fixes for having all 2007-11-20 15:11:49 +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.

. reformat

  A timestamp column is formated the way MySQL dump its timestamp,
  which is not the same as the way PostgreSQL reads them. The
  reformat.mysql module is used to reformat the data on-the-fly.

. udc

  A used defined column test, where all file columns are not used but
  a new constant one, not found in the input datafile, is added while
  loading data.

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 -Tsc pgloader.conf
 
 [...]

 Table name        |    duration |    size |  copy rows |     errors
 ====================================================================
 clob              |      0.043s |   32 kB |          7 |          0
 cluttered         |      0.032s |   32 kB |          6 |          0
 csv               |      0.031s |   16 kB |          6 |          0
 errors            |      0.030s |   32 kB |          4 |          3
 partial           |      0.078s |   32 kB |          7 |          0
 reformat          |      0.018s |   24 kB |          4 |          1
 serial            |      0.024s |   32 kB |          7 |          0
 simple            |      0.024s |   32 kB |          7 |          0
 udc               |      0.018s |   32 kB |          5 |          0
 ====================================================================
 Total             |      0.298s |  264 kB |         53 |          4


Please note errors test should return 3 errors and reformat 1 error.