Dimitri Fontaine built pgLoader because database migrations suck. If you've ever tried to move data from MySQL to PostgreSQL manually, you know what I'm talking about. The endless charset issues, the 0000-00-00
datetime values that PostgreSQL hates, the schema differences that make you want to cry.
Why pgLoader Actually Works (Unlike Most Migration Tools)
Uses PostgreSQL's COPY Protocol (Which is Actually Fast)
Instead of doing row-by-row INSERTs like an amateur, pgLoader uses PostgreSQL's native COPY command for bulk loading.
This leverages PostgreSQL's bulk loading capabilities and efficient data streaming protocols. We're talking about loading millions of rows without your terminal hanging for hours, unlike slower row-by-row INSERT methods.
Doesn't Die When Bad Data Shows Up
Here's the thing: your source database has shit data. MySQL lets you store 0000-00-00
dates and empty strings where they shouldn't be. Instead of failing completely, pgLoader saves the garbage to `.reject.dat` and `.reject.log` files so you can deal with it later.
Actually Converts Your Schema
pgLoader reads your MySQL/SQLite/Oracle schema and creates equivalent PostgreSQL tables automatically. It handles the type conversions, foreign keys, indexes - the stuff that would take you weeks to figure out manually. Check the MySQL type mapping documentation and PostgreSQL data types to see what it converts. It also handles character set conversions and collation mapping.
Continuous Migration That Doesn't Suck
You can run continuous migrations during development so you're not scrambling to figure out what broke when you finally migrate production. Test your migration script daily instead of praying it works on go-live day.
What Can This Thing Migrate?
pgLoader supports way more than just databases:
- Databases: MySQL, SQLite, MS SQL Server, Oracle
- Files: CSV, fixed-width text, dBase3 (.dbf), IBM IXF
- Compressed: ZIP, TAR, GZIP archives (it extracts them automatically)
- Remote: HTTP/HTTPS URLs - just point it at a CSV on the web
The current version is 3.6.9 (released October 24, 2022) and it's actively maintained. Not like those abandoned SourceForge projects from 2008. Check the release history and commit activity to see it's still being developed.
How Much Time Will This Actually Save?
Look, I've been through MySQL-to-PostgreSQL hell three times. First migration took 16 hours because we didn't know about the charset issues. Second time the migration 'succeeded' but half our datetime fields were fucked. Third time with pgLoader: estimated 4 hours, took 11 hours because MySQL kept timing out on large tables.
Our 'simple' 200GB migration turned into a 3-day nightmare when we discovered our source database had 15 different character encodings. The 0000-00-00
dates were just the beginning. We ended up with 47,000 rejected rows and had to manually clean data that should have been garbage 5 years ago.
But here's the thing - pgLoader at least tells you when shit breaks instead of silently corrupting your data like the custom scripts I wrote before. The parallel loading and optimized PostgreSQL configuration can turn a week-long manual migration into an afternoon. Just don't expect miracles if your source data is complete garbage.