Description
When using pgloader to perform a data-only migration from Microsoft SQL Server to PostgreSQL, and specifying a column naming convention such as snake_case, an additional underscore is incorrectly added to column names that already contain underscores.
Steps to Reproduce
- In SQL Server, have a table with a column named
Column_Name.
- Use
pgloader with data only migration enabled and with snake_case name transformation.
- Observe that pgloader attempts to write to a column named
column__name (with a double underscore) instead of the correct column_name.
Expected Behavior
pgloader should map the column as it is from sql server to psql without adding an underscore if it has one.
Actual Behavior
pgloader transforms Column_Name into column__name, inserting an additional underscore, which causes a mismatch with the actual column names in the PostgreSQL schema and results in a migration failure.
Additional Notes
- This issue only occurs during data-only migration when the PostgreSQL schema is pre-created.
- The error does not occur when
pgloader is allowed to create the schema (as it then matches its own column naming logic).
Wasn't able to find any command in the docs that handles this part.
Description
When using
pgloaderto perform a data-only migration from Microsoft SQL Server to PostgreSQL, and specifying a column naming convention such assnake_case, an additional underscore is incorrectly added to column names that already contain underscores.Steps to Reproduce
Column_Name.pgloaderwithdata onlymigration enabled and withsnake_casename transformation.column__name(with a double underscore) instead of the correctcolumn_name.Expected Behavior
pgloadershould map the column as it is from sql server to psql without adding an underscore if it has one.Actual Behavior
pgloadertransformsColumn_Nameintocolumn__name, inserting an additional underscore, which causes a mismatch with the actual column names in the PostgreSQL schema and results in a migration failure.Additional Notes
pgloaderis allowed to create the schema (as it then matches its own column naming logic).Wasn't able to find any command in the docs that handles this part.