Reputation: 3
I am working in a stand alone JAVA application using postgreSQL 7.4.2 as database. The application is not working in Windows 7. The postgreSQL server is run using cygwin. shell scripts are written to install the postgreSQL from source code, setup the server and create the database during application installation(currently the application runs on Windows XP)
We have decided to update to 9.4.2 version of postgreSQL. But in the manual it is written that "Running postgreSQL server using cygwin environment is not recommended".
My question is: If cygwin is not recommended then what is the alternate environment to install the postgreSQL from source code, setup the server and create the database during application installation on Windows 7.
I am a JAVA developer, not a database guy. But i was asked to do this migration. please help me in getting things right.
Upvotes: 0
Views: 584
Reputation: 324771
On Windows, your best bet is to bundle the .zip binaries of a pre-built PostgreSQL release. This gives you the same pre-tested binaries that're distributed in the installer and makes updating to a new point release as easy as stopping the server, replacing the binaries, and starting the server.
You can get pre-built binaries of stock PostgreSQL from EnterpriseDB.
If you insist on building from source, do so using the native Microsoft Visual C++ toolchain as documented in the PostgreSQL manual here. Getting the pre-requisite libraries is quite painful, so I wrote some tools that help with this; you can find the pg_build_win tool here. I strongly recommend that you use the prebuilt binaries instead of building your own unless you have extremely compelling reasons; that tool is mostly intended for automated integration testing and development use.
Please don't use PostgreSQL on Cygwin. It's not well tested or well supported and it may go away in a future release if the couple of users who still care about it stop maintaining it. If for whatever reason you can't/won't use MSVC, you can use the gcc-based MinGW toolchain to build native Windows binaries.
If your program runs under Cygwin and hasn't been ported to run under native Windows yet (you should probably get onto that) you can safely compile and use libpq
under Cygwin to connect to a native Windows PostgreSQL build.
(BTW, it's "Java" not "JAVA"; it isn't an acronym).
Upvotes: 2