pgloader/examples
2007-11-28 21:06:14 +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
reformat packaging of 2.2.4 2007-11-21 10:27:22 +00:00
serial Support partial columns definition for COPY 2007-01-19 11:30:09 +00:00
simple * Support for datestyle setting 2007-08-23 10:38:09 +00:00
udc pgloader version 2.2.3, with User Defined Columns 2007-11-14 21:09:36 +00:00
pgloader.conf Catch IOError: commit code, not wrong example/pgloader.conf 2007-11-28 21:06:14 +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.