Pg::BulkCopy

A Perl module
Download

Pg::BulkCopy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Publisher Name:
  • John Karr
  • Publisher web site:
  • http://search.cpan.org/~brainbuz/

Pg::BulkCopy Tags


Pg::BulkCopy Description

A Perl module Pg::BulkCopy was written to provide PostgreSQL with a convenient bulk loading utility. The script is implemented as a wrapper and a module (pg_BulkCopy.pl) so that other programmers may easily incorporate the two useful methods LOAD and DUMP directly into other perl scripts.The advantage of this script over other scripts that have been written for this purpose is that if you can connect to and perform insert and delete operations on your database through the standard DBI interface (and it shouldn't matter which of the several postgres driver's you are using), pg_BulkCopy should just work.The DUMP Method invokes postgres' COPY TO command, and does nothing useful in addition except copying the dump from the temp directory (because postgres may not have permission on where you want the file). You can choose Tab Delimited Text or CSV with whatever delimiter you want and a Null string of your choice.The LOAD Method is much more interesting, it breaks the load file into chunks of 10000 (configurable) records in the temp directory and tries to COPY FROM, if it fails, it parses the error message for the line number, then it removes the failed line to a rejects file and tries again. As with DUMP you can select the options supported by the postgres COPY command, you can also set a limit on bad records (default is 10).Documentation: http://search.cpan.org/~brainbuz/Pg-BulkCopy-0.14/lib/Pg/BulkCopy.pm Requirements: · Perl


Pg::BulkCopy Related Software