Search code examples
postgresqlpgloader

Postgres - pgloader - Column names are converted to lower case in PostgreSQL by default


I have inherited a large MySQL database and want to move data to postgresql db. In this case when I run below command to dump data from MySQL, facing the issue that column names are converted to lower case in PostgreSQL by default., But expected is PostgreSQL to keep column names in upper or mixed case what exactly from MySQL db.

 pgloader mysql://root:password@$localhost/accessdatabase \
 postgresql://postgres:password@postgres/accessdatabase

Having an issue with column names being converted to lower case during migration from MySQL to Postgres.

Is there a query I can run migrate what same as MySQL db to postgresql db?


Solution

  • Use --with "quote identifiers" option, that instructs pgloader to quote all identifiers, thus preserving their original case from MySQL.

    pgloader mysql://root:password@localhost/accessdatabase \
             postgresql://postgres:password@postgres/accessdatabase \
             --with "quote identifiers"