EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
532 stars 163 forks source link

Foreign schema is not present on foreign server #214

Closed mrendi29 closed 3 years ago

mrendi29 commented 3 years ago

The mysql_fdw is not importing certain foreign schemas despite the schema existing on the foreign MySQL server. I have tried other schemas and they import fine

I get the following error: ERROR: schema "foreign_schema" is not present on foreign server "foreign_server"

I traced the source code to here: https://github.com/EnterpriseDB/mysql_fdw/blob/master/mysql_fdw.c#L2033

surajkharage19 commented 3 years ago

Thanks @mrendi29 for reporting this. Can you please share the small reproducible test case where you are unable to import schema and getting an error? It would be good if you provide schema/database DDL from MySQL along with IMPORT FOREIGN SCHEMA command. The error is expected when the schema/database does not exist on MySQL side.

mrendi29 commented 3 years ago

@surajkharage19 I was able to fix the issue this morning. I had to use double quotes around the tables i was specifying in the LIMIT TO statement