Migrating MySQL database to Postgresql
Posted: Wed Feb 17, 2021 6:13 am
I havea qt application which was using qxorm library to communicate with MySql database.
Now we want to migrate the database to Postgresql.
As suggested we made changes below:
With the above changes i was able to connect to database but the queries are failing because postgresql folds the table name and column name to lowercase if they are not surrounded by quotes. I was expecting it to work straight away without any changes to queries.
Is there any way to resolve this issue which I am facing.
Now we want to migrate the database to Postgresql.
As suggested we made changes below:
- Code: Select all
qx::QxSqlDatabase::getSingleton()->setDriverName("QPSQL");
qx::QxSqlDatabase::getSingleton()->setDatabaseName(database);
qx::QxSqlDatabase::getSingleton()->setHostName("localhost");
qx::QxSqlDatabase::getSingleton()->setUserName("postgres");
qx::QxSqlDatabase::getSingleton()->setPassword("postgres");
With the above changes i was able to connect to database but the queries are failing because postgresql folds the table name and column name to lowercase if they are not surrounded by quotes. I was expecting it to work straight away without any changes to queries.
Is there any way to resolve this issue which I am facing.