Go to file
Svante von Erichsen d9ca38eacf
Merge pull request #1674 from fossum/feature/fix-dockerfile-casing
Eliminate docker build casing warning
2025-06-04 09:52:57 +02:00
.github Use latest cosign action to fix signing issue on docker publish (#1613) 2024-09-18 14:26:47 +02:00
build Add a bundle distribution. 2016-01-31 21:47:14 +01:00
bundle Set SBCL dynamic space size to 16 GB on 64 bit architectures. 2022-08-12 22:57:51 +02:00
conf specify v8 of freetds to deal with #1068 'MSSQL to Postgres: is not of type VECTOR' 2022-06-23 13:48:34 +02:00
debian Merge branch 'debian' 2024-06-11 17:01:37 +00:00
docs fix IPv6 hostname parsing (#1004) 2025-05-25 01:26:22 +02:00
src fix IPv6 hostname parsing (#1004) 2025-05-25 01:26:22 +02:00
test Remove regression output on clean 2022-06-26 23:32:55 +02:00
.dockerignore Improved Dockerfiles/docker image size (#821) 2018-08-11 01:08:00 +02:00
.gitattributes Fix github language statistics. 2017-03-26 11:26:29 +02:00
.gitignore Ignore some Debian build artifacts 2022-06-23 16:08:36 +02:00
.readthedocs.yaml Add a setup for readthedocs. 2022-10-18 19:51:15 +02:00
.travis.sh Simplify and fix errors/warnings/notes on Travis configuration (#1112) 2020-03-28 13:42:18 +01:00
.travis.yml Add postgres version 13 tto Travis (#1235) 2020-11-21 20:13:08 +01:00
bootstrap-centos7.sh Update scripts to reference freetds-devel. 2016-11-01 21:08:31 +01:00
bootstrap-centos.sh bootstrap-centos.sh: Bump sbcl version to 2.2.5 2022-06-24 16:28:51 +02:00
bootstrap-debian.sh Bump ip4r dependencies to 15 2022-10-24 12:59:19 +02:00
Dockerfile Eliminate docker build casing warning 2025-06-03 08:41:13 -07:00
Dockerfile.ccl Pin Debian version to Bookworm and fix dependencies 2023-06-13 15:50:56 +03:00
INSTALL.md Update rpm spec file (#1039) 2020-02-12 21:02:49 +01:00
ISSUE_TEMPLATE.md Some improvements on the GitHub issue template. 2018-02-17 00:18:42 +01:00
LICENSE Let's be more specific about the license. 2017-06-17 19:21:33 +02:00
Makefile pgloader 3.6.10 2023-11-02 16:49:50 +00:00
pgloader.asd Improve documentation with command lines and defaults. (#1415) 2022-08-12 15:27:40 +02:00
pgloader.spec pgloader 3.6.10 2023-11-02 16:49:50 +00:00
README.md (Re-)Fix documentation link (#1434) 2022-09-21 00:40:51 +02:00
TODO.md Fixed typos 2015-02-18 23:17:16 +00:00
Vagrantfile Allow pgloader to work on windows. 2014-11-06 22:12:20 +01:00

PGLoader

Build Status Join the chat at https://gitter.im/dimitri/pgloader Read The Docs Status

pgloader is a data loading tool for PostgreSQL, using the COPY command.

Its main advantage over just using COPY or \copy, and over using a Foreign Data Wrapper, is its transaction behaviour, where pgloader will keep a separate file of rejected data, but continue trying to copy good data in your database.

The default PostgreSQL behaviour is transactional, which means that any erroneous line in the input data (file or remote database) will stop the entire bulk load for the table.

pgloader also implements data reformatting, a typical example of that being the transformation of MySQL datestamps 0000-00-00 and 0000-00-00 00:00:00 to PostgreSQL NULL value (because our calendar never had a year zero).

Documentation

Full documentation is available online, including manual pages of all the pgloader sub-commands. Check out https://pgloader.readthedocs.io/.

$ pgloader --help
pgloader [ option ... ] SOURCE TARGET
  --help -h                       boolean  Show usage and exit.
  --version -V                    boolean  Displays pgloader version and exit.
  --quiet -q                      boolean  Be quiet
  --verbose -v                    boolean  Be verbose
  --debug -d                      boolean  Display debug level information.
  --client-min-messages           string   Filter logs seen at the console (default: "warning")
  --log-min-messages              string   Filter logs seen in the logfile (default: "notice")
  --summary -S                    string   Filename where to copy the summary
  --root-dir -D                   string   Output root directory. (default: #P"/tmp/pgloader/")
  --upgrade-config -U             boolean  Output the command(s) corresponding to .conf file for v2.x
  --list-encodings -E             boolean  List pgloader known encodings and exit.
  --logfile -L                    string   Filename where to send the logs.
  --load-lisp-file -l             string   Read user code from files
  --dry-run                       boolean  Only check database connections, don't load anything.
  --on-error-stop                 boolean  Refrain from handling errors properly.
  --no-ssl-cert-verification      boolean  Instruct OpenSSL to bypass verifying certificates.
  --context -C                    string   Command Context Variables
  --with                          string   Load options
  --set                           string   PostgreSQL options
  --field                         string   Source file fields specification
  --cast                          string   Specific cast rules
  --type                          string   Force input source type
  --encoding                      string   Source expected encoding
  --before                        string   SQL script to run before loading the data
  --after                         string   SQL script to run after loading the data
  --self-upgrade                  string   Path to pgloader newer sources
  --regress                       boolean  Drive regression testing

Usage

You can either give a command file to pgloader or run it all from the command line, see the pgloader quick start on https://pgloader.readthedocs.io for more details.

$ ./build/bin/pgloader --help
$ ./build/bin/pgloader <file.load>

For example, for a full migration from SQLite:

$ createdb newdb
$ pgloader ./test/sqlite/sqlite.db postgresql:///newdb

Or for a full migration from MySQL, including schema definition (tables, indexes, foreign keys, comments) and parallel loading of the corrected data:

$ createdb pagila
$ pgloader mysql://user@localhost/sakila postgresql:///pagila

LICENCE

pgloader is available under The PostgreSQL Licence.

INSTALL

Please see full documentation at https://pgloader.readthedocs.io/.

If you're using debian, it's already available:

$ apt-get install pgloader

If you're using docker, you can use the latest version built by the CI at each commit to the master branch:

$ docker pull ghcr.io/dimitri/pgloader:latest
$ docker run --rm -it ghcr.io/dimitri/pgloader:latest pgloader --version