I'm trying to migrate a legacy MySQL database into Postgres using Pgloader. I'm trying to think of a relatively robust way to find a way to convert the existing SQL queries to work with the new database with the least amount of manual modifications.
One of the big pain points is that the old database is written in mixed case, and so are all the SQL queries. If you query SELECT Table.Column Postgres will treat that as select table.column so it doesn't work out of the box. Converting the database tables and columns to lowercase is not an option.
Of course one option would be to manually add quotes around each identifier in all of the queries eg `SELECT "Table"."Column", but I'm wondering if there's another way that I haven't thought of, like a Postgres module or something.
Any help would be highly appreciated!