I encountered a similar issue while attempting to migrate my MySQL database to PostgreSQL using pgloader
, specifically the error:
MySQL 7.6 fell through ECASE expression at /build/pgloader-4.0.0~beta1/build/sources/libs/dbd-mysql/mysql.c:1638
After some investigation, I realized the problem stemmed from the way pgloader
was built. I had cloned the repository from GitHub, assuming a standard build process would suffice. However, I overlooked a crucial step in the installation documentation.
The key to resolving this error, as highlighted in the official pgloader
documentation (https://pgloader.readthedocs.io/en/latest/install.html#build-from-sources), is to explicitly run the $ make save
command after cloning the repository.
This command is essential as it handles specific build configurations necessary for pgloader
to interact correctly with different database versions. Simply running a generic make
command might not include these crucial steps.
Therefore, the solution that worked for me was:
Clone the pgloader
repository:
Bash
git clone https://github.com/dimitri/pgloader.git
cd pgloader
Execute the $ make save
command:
Bash
make save
By ensuring the $ make save
command is executed, the necessary build artifacts are created, allowing pgloader
to handle the nuances of the MySQL version and successfully proceed with the migration.
Hopefully, this clarifies the issue and helps others facing the same error during their MySQL to PostgreSQL migration with pgloader
!