Volver al ranking

dimitri/pgloader

Common Lisppgloader.io

Migrate to PostgreSQL in a single command!

postgresqlmigrationmysqlmssqlsqlitecommon-lisppgloadersbclclozure-cldatabasecsvixf
Crecimiento de estrellas
Estrellas
6.5k
Forks
605
Crecimiento semanal
Issues
18
2k4k6k
abr 2011may 2016jun 2021jul 2026
README

pgloader

pgloader v4 CI Read The Docs

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).

Version 4 — Clojure/JVM rewrite

pgloader v4 is a full rewrite in Clojure, distributed as a single self-contained JAR requiring Java 21 or later. It is a drop-in replacement for v3 and accepts the same .load file syntax and command-line flags.

Key improvements over v3:

  • Single JAR — no native dependencies, no SBCL, no shared libraries
  • JDBC connection strings — use jdbc:mysql://, jdbc:postgresql://, jdbc:sqlserver:// etc. everywhere; driver-specific parameters pass through unchanged
  • Java heap — no more Common Lisp heap exhaustion on large migrations; tune with standard -Xmx JVM flag
  • SSL via URI — use ?sslmode=require / ?sslmode=disable in the connection string instead of --no-ssl-cert-verification

Documentation

Full documentation is available at https://pgloader.readthedocs.io/.

$ java -jar pgloader.jar --help
pgloader [ option ... ] SOURCE TARGET
  --help                          Show usage and exit.
  --version                       Display pgloader version and exit.
  --quiet                         Be quiet.
  --verbose                       Be verbose.
  --debug                         Display debug level information.
  --client-min-messages           Filter logs seen at the console (default: info)
  --log-min-messages              Filter logs seen in the logfile (default: info)
  --logfile                       Filename where to send the logs.
  --summary                       Filename where to copy the summary.
  --root-dir                      Output root directory (default: /tmp/pgloader/).
  --list-encodings                List pgloader known encodings and exit.
  --dry-run                       Check connections only, don't load anything.
  --on-error-stop                 Stop on first error instead of continuing.

Usage

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

$ java -jar pgloader.jar --help
$ java -jar pgloader.jar <file.load>

For example, for a full migration from SQLite:

$ createdb newdb
$ java -jar pgloader.jar ./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
$ java -jar pgloader.jar mysql://user@localhost/sakila postgresql:///pagila

INSTALL

pgloader v4 requires Java 21 or later (Temurin, OpenJDK, or any compatible distribution).

Download the latest pre-release JAR — this URL always points to the most recent build from the v4-clojure-rewrite branch:

$ curl -L -o pgloader.jar \
    https://github.com/dimitri/pgloader/releases/download/v4-dev/pgloader.jar
$ java -jar pgloader.jar --version

To make it available system-wide:

$ sudo install -m 755 pgloader.jar /usr/local/lib/pgloader.jar
$ echo '#!/bin/sh\nexec java -jar /usr/local/lib/pgloader.jar "$@"' \
    | sudo tee /usr/local/bin/pgloader
$ sudo chmod 755 /usr/local/bin/pgloader
$ pgloader --version

Docker

The latest image is built by CI on every push to v4-clojure-rewrite:

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

Debian / Ubuntu (v3)

The v3 package is available in the Debian and Ubuntu repositories:

$ apt-get install pgloader

A v4 Debian package is planned.

LICENCE

pgloader is available under The PostgreSQL Licence.

Repositorios relacionados
supabase/supabase

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

TypeScriptnpmApache License 2.0firebasesupabase
supabase.com
106.7k13.2k
netdata/netdata

The fastest path to AI-powered full stack observability, even for lean teams.

GoGo ModulesGNU General Public License v3.0monitoringdocker
netdata.cloud
79.8k6.5k
nocodb/nocodb

🔥 🔥 🔥 A Free & Self-hostable Airtable Alternative

TypeScriptnpmOtherautomatic-apiairtable
nocodb.com
64.2k4.9k
makeplane/plane

🔥🔥🔥 Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

TypeScriptnpmGNU Affero General Public License v3.0djangodocker
plane.so
54.8k5k
maybe-finance/maybe

The personal finance app for everyone

RubyRubyGemsGNU Affero General Public License v3.0financepersonal-finance
54.4k5.6k
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

TypeScriptnpmOthercrmcustomer
twenty.com
53.4k8.1k
dbeaver/dbeaver

Free universal database tool and SQL client

JavaMavenApache License 2.0sqldatabase
dbeaver.io
51.1k4.3k
metabase/metabase

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

ClojureOtheranalyticsbusinessintelligence
metabase.com
48.3k6.7k
gogs/gogs

The painless way to host your own Git service

GoGo ModulesMIT Licensegogsgo
gogs.io
47.7k5.1k
discourse/discourse

A platform for community discussion. Free, open, simple.

RubyRubyGemsGNU General Public License v2.0discoursejavascript
discourse.org
47.5k9k
prisma/prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

TypeScriptnpmApache License 2.0prismaorm
prisma.io
47.4k2.4k
calcom/cal.diy

Scheduling infrastructure for absolutely everyone.

TypeScriptnpmMIT Licenseopen-sourcetypescript
cal.diy
46.7k14.5k