user3422637
user3422637

Reputation: 4239

ERROR: could not open extension control file "C:/Program Files/PostgreSQL/9.3/share/extension/mysql_fdw.control": No such file or directory

I want to setup MySQL FDW (Foreign Data Wrapper) for PostgreSQL in Windows.

I installed pgAdmin III in Windows, which also installs postgreSQL. I then ran this command in the SQL window of pgAdmin. I got this error:

ERROR: could not open extension control file "C:/Program Files/PostgreSQL/9.3/share/extension/mysql_fdw.control": No such file or directory

It looks to me that I need to do a few pre-requisite steps. But I don't find any proper documentation which walks me through step by step. You may redirect to this page: https://github.com/EnterpriseDB/mysql_fdw

But I think these instructions are for Linux. I don't know how to make them work for Windows. Also, the first few instructions are quite vague. If I am running postgres on a windows desktop, what all do I need to do? I don't know of any make command or export command in Windows.

Upvotes: 0

Views: 4604

Answers (1)

Zertrin
Zertrin

Reputation: 260

I was able today to successfully use the precompiled DLLs found here to integrate the mysql_fdw 1.0.0 into a fresh PostgreSQL 9.3 32bit install from the official installers on Windows Server 2012 64bit.

Here is what I did:

  • Install PostgreSQL 9.3.9 32bit from the latest official installer (postgresql-9.3.9-1-windows.exe)
  • Download postgresql-9.3.1-standalone-32-(sqlite_fdw,www_fdw,mysql_fdw,ldap_fdw).7z from http://sourceforge.net/projects/postgresql-mingw-w64/files/
  • Extract the archive somewhere (let's assume C:\somewhere\postgresql-9.3.1-standalone-32).
  • In the extracted folder, go to C:\somewhere\postgresql-9.3.1-standalone-32\01_DLLs_32-DEPLOY_EXTS
  • run deploy-x86-on-win64.bat if running Windows 64 bit, deploy-x86-on-win32.bat otherwise.
  • In PgAdmin III, right-click on your database (let's assume postgres), choose New Object > New Extension
  • In the New Extension... dialog, open the drop-down list for the Name and select for mysql_fdw. (If not found, something must have messed up earlier.). Finish by clicking on OK.

If everything went well, that's it!

From this point on you will need to create the Foreign Server, the Foreign Table and so on.

I personally used the example given here at the bottom of the page: http://pgxn.org/dist/mysql_fdw/1.0.0/

Note: if using a 64bit build of PostgreSQL, I assume that the procedure should be similar, with the exception that you need to download postgresql-9.3.1-standalone-64-(sqlite_fdw,www_fdw,mysql_fdw,ldap_fdw).7z. But I haven't tested it! Mileage may vary.

Upvotes: 1

Related Questions