Description
When migrating from MySQL to PostgreSQL using data-only mode, pgloader v4 fails if MySQL columns have uppercase names (e.g. MY_COLUMN) while the corresponding PostgreSQL columns are lowercase (my_column). This worked correctly in pgloader v3, where column name casing was automatically normalized during migration.
Steps to Reproduce
- Create a MySQL table with uppercase column names (e.g. MY_COLUMN, ANOTHER_COL)
- Create the corresponding PostgreSQL table with lowercase column names (my_column, another_col)
- Run pgloader v4 in data-only mode to migrate data from MySQL to PostgreSQL.
Expected Behavior
pgloader should normalize column name casing when mapping MySQL columns to PostgreSQL columns, as it did in v3.
Actual Behavior
pgloader v4 uses the MySQL column names as-is (uppercase), resulting in errors:
ERROR: column "MY_COLUMN" does not exist
COPY init failed: ERROR: syntax error at or near ")"
Failed to re-enable triggers: current transaction is aborted, commands ignored until end of transaction block
INDEX and PK INDEX creation also fails with the same column-not-found error. The entire table migration is aborted.
Why quoting is not a viable workaround?
On PostgreSQL, using double-quoted identifiers (e.g. "MY_COLUMN") to preserve uppercase naming is not a practical solution. Quoted identifiers make PostgreSQL treat column names as case-sensitive, which breaks existing application queries that reference columns without quotes.
Any query using SELECT my_column FROM ... would fail because PostgreSQL would no longer match it to "MY_COLUMN". This forces changes across the entire application layer, which is unacceptable for production migrations.
Environment
- Source: MySQL 8.0
- Target: PostgreSQL (lowercase column convention)
- pgloader: v4 (Clojure rewrite)
- Mode: data-only migration
Notes
This is a regression from pgloader v3, which handled case-mismatched columns without issue. Since v4 is a complete rewrite in Clojure, the column name normalization logic from v3 appears to be missing.
Description
When migrating from MySQL to PostgreSQL using data-only mode, pgloader v4 fails if MySQL columns have uppercase names (e.g. MY_COLUMN) while the corresponding PostgreSQL columns are lowercase (my_column). This worked correctly in pgloader v3, where column name casing was automatically normalized during migration.
Steps to Reproduce
Expected Behavior
pgloader should normalize column name casing when mapping MySQL columns to PostgreSQL columns, as it did in v3.
Actual Behavior
INDEX and PK INDEX creation also fails with the same column-not-found error. The entire table migration is aborted.
Why quoting is not a viable workaround?
On PostgreSQL, using double-quoted identifiers (e.g. "MY_COLUMN") to preserve uppercase naming is not a practical solution. Quoted identifiers make PostgreSQL treat column names as case-sensitive, which breaks existing application queries that reference columns without quotes.
Any query using SELECT my_column FROM ... would fail because PostgreSQL would no longer match it to "MY_COLUMN". This forces changes across the entire application layer, which is unacceptable for production migrations.
Environment
Notes
This is a regression from pgloader v3, which handled case-mismatched columns without issue. Since v4 is a complete rewrite in Clojure, the column name normalization logic from v3 appears to be missing.