Most of the people who do development work of the PostgreSQL system do so in a Unix-like environment, so that is where most of the testing is also done. Committed patches are automatically tested on MicroSoft Windows by the Build Farm, but the turn around time on that testing is too slow to be convenient for people who do not work in a Window environment but are touching parts of the code which have cross-platform implications, or for issues which are not explored by the standard build and regression tests but require custom testing. Also, during commitfests patches that relate to Windows often suffer from a shortage of peer reviewers: hopefully instructions in use of MinGW for building on Windows can help that.
The format of numbers in SQL expressions does not change with locale settings. That would be madness. That would be madness. On a different note: you are aware that you have to (at least) reload the server after changing postgresql.conf. There are two ways to connect to a local PostgreSQL server: Using a TCP connection (localhost, 127.0.0.1,::1) Using a Unix socket connection (/tmp/.s.PGSQL) Postico always uses TCP connections. Postico can't use socket connections because sandboxed apps are not allowed to access unix sockets outside their sandbox. Postico is a modern Postgres client for OSX, built by the same developer who built Postgres.app (mentioned above). It is free, but you can buy a license to unlock additional power features. This is the GUI that I use to manage Postgres because it is built specifically for Mac and has a beautiful, very easy to use (but powerful) UI.
Production releases of PostgreSQL for Windows are generally built using MicroSoft's commercial compilers, but these are often not cost-free and can be very hard to use for people more accustomed to a Linux environment. These instructions are intended to help such developers test their code on Windows without much cost and without having to turn themselves into Windows developers.
Set up
If you do not have access to a Microsoft Windows environment, you can rent one from Amazon Web Services. You will need to have some kind of graphical environment, like X-Windows, to enable you to connect to Windows over RDP. Most modern Linux systems will have readily available such a graphical environment and the 'rdesktop' program to enable you to connect to Windows.
A t1.micro spot instance has a current price of $0.006 / hour (2013/02/23) and may be free if you have been an AWS customer for less than an year. But it will be slow! Also consider a t2.micro which may be faster if it's available. For a little more, m3.medium is a good choice. As of 2015/09/28 the spot price for this is just under $0.06 per hour.
If you have a Windows system of your own and are willing to install MinGW on it, then the steps of creating and connecting to an Amazon instance can be skipped. If you do run this locally and are not logged on as the administrator, then you can also skip the steps where you create an unprivileged user and run as that user.
The above steps can take a while and download several hundred MB of data, so if you are using an Amazon instance it may be worthwhile to arrange to store this set up for future work so that it does not need to be repeated. (Could someone add instructions on how to do that?)
Build from a tarball
Make some coffee and do the crossword or read War and Peace - this can take a while.
Installing Git
If you want to build from the git repo instead of a tarball snapshot, which you will need to do if you're doing development, you need to install a git client.
Open https://git-for-windows.github.io/ and grab the latest version. As of the time of writing this is called Git-2.5.3-32-bit.exe or Git-2.5.3-64-bit.exe. Run this installer. Choose an install path that's easy to manage rather than the default, such as 'c:proggit'. You might get permissions errors. If so, try running again, or else try running as the Administrator.Uncheck all the options unless you think you will need them - you won't need them for command line use from Msys. Don't set up a Start Menu folder, unless you want one - Msys won't need that either. Select 'Run git from Windows command prompt' and 'Checkout as-is, commit as-is.'
After this git should be in your path on Msys, and just work. Verify by running 'git --help' in an Msys window started after you installed git.
Build from a git repoPostico 1 5 4 – A Modern Postgresql Client Setting Example
We'll use github's mirror here to check out postgres, to avoid overloading the master repo.
Postico 1 5 4 – A Modern Postgresql Client Settings
Then follow the same 64-bit or 32-bit build instructions as for building from a tarball.
Installing
After you have built you can install by running
Following this you need to copy the libpq dll from the installation lib directory to the installation bin directory. This lets pg_ctl and psql and other client programs work.
Using psql interactively
The psql client doesn't work well in the rxvt terminal emulator, and appears to hang. Instead you can open a non-rxvt shell by omitting the '--rxvt' flag when opening a session, and psql works as expected.It also works in the normal Windows command window, and in the Windows Power Shell window. None of these builds have readline installed, so you don't get psql history, command completion and so on. If you want to do lots of work with psql on Windows, the best way might be to build and run psql under Cygwin, where readline is fully supported. That's what I do.
AlternativesCross Compiling
Another alternative to needing/using a windows box is to cross compile postgres from a linux box, ex (ubuntu):
Then you can run to test it using wine [or copying it to a windows box and running natively, of course].
Postico 1 5 4 – A Modern Postgresql Client Setting PermissionsCygwin
You can install cygwin and build it 'just like you would in linux' using cygwin's packages (gcc etc.), from inside a windows box.
Virtualbox
You can also run windows inside a virtualbox VM inside your Linux box.
Retrieved from 'https://wiki.postgresql.org/index.php?title=Building_With_MinGW&oldid=25922'
Interactive installer by EDB
Download the installer certified by EDB for all supported PostgreSQL versions.
This installer includes the PostgreSQL server, pgAdmin; a graphical tool for managing and developingyour databases, and StackBuilder; a package manager that can be used to download and installadditional PostgreSQL tools and drivers. Stackbuilder includes management,integration, migration, replication, geospatial, connectors and other tools.
This installer can run in graphical or silent install modes.
The installer is designed to be a straightforward, fast way to get up and running withPostgreSQL on Windows.
Advanced users can also download azip archiveof the binaries, without the installer.This download is intended for users who wish to include PostgreSQL as part of another application installer.
Platform support
The installers are tested by EDB on the following platforms. They can generally be expected to run on other comparable versions:
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |