Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

PostgreSQL installation

Surf to http https://www.postgresql.org/ and download the installer for the
latest release. For new , MS Windows users we recommend the "One click installer".
After launching this installer you have to follow these installation screens.
Note that for Windows 7 and Windows Vista you can not just click "next" but
have to pay attention to avoid a fatal installation issue.

Image Removed

Image Removed Image Removed

We recommend to keep the standard installation path for Windows XP. However, for Windows 7 and Windows Vista you can not install in a sub directory of the "program files" folder, e.g. the default c:\Program Files\PostgreSQL. Due to rigid security policy on these windows versions, the postgres user has no access to the "program files" folder. Installation will fail, and the error message will not display until the end of the installation process. Here we install in c:\PostgreSQL to avid this issue. For more details see this note. If you are not administrator, you might have to give the postgres user access manually for this other folder after the completion of the installation procedure and then reinstall (without prior uninstalling) PostgreSQL.

Image Removed Note we changed folder!
Image Removed Note we changed folder!

Now you can proceed with installation without further caveats.

Image Removed

Unlike a local file system with data filed, PostgreSQL always requires
log-in credentials. Remember to store these credentials well in a safe place.
You are the DBA (DataBase Administrator) of your local PostgreSQL database.

If you use the local PostgreSQL only as sandbox for learning how to work with
PostgreSQL, or as a cache for temporary project data, storing log-in credentials
in a function may be a convenient approach. For Matlab users a suggestion is to
save the credentials in a special function to automatic reuse. Of course this
is not recommended if you will use the local PostgreSQL for storing sensitive information.

Code Block

function [user,pass]=pg_credentials

user = 'postgres';
pass = 'MyP@$$word';

Image Removed
Image Removed
Image Removed
Image Removed
Image Removed

You can now proceed with installing PostGIS.

If you see the "PostgreSQL Database Cluster Initialisation Failed Solution" error below at then end of the installation, you forgot to pay attention and installed and installed in c:\Program Files\PostgreSQL. This is known to lead to failure of installation. Solution: uninstall, and reinstall in_ another folder_, e.g. c:\PostgreSQL outside "Program Files\".

best use the Interactive installer by EDB.

If you already have a database installed and want to migrate to a newer version, please follow the steps described on https://www.postgresql.org/docs/9/migration.html

The installer will prompt you several times. Take notice of the screen that prompts you for selection of components. Uncheck pgAdmin4. Install this as separate installer.

Image Added

Proceed with with the installation of PostgreSQL. and choose spatial extension. After installing the base application Stack Builder will popup to install additional software. Select Spatial Extensions and select PostGIS. 

Image Added

It is not necessary to check Create spatial database. 

To work with PostgreSQL/PostGIS there are several user interfaces. pgAdmin being one of them with a very active developer community. Every other month a new version is made available. That is the reason to install pgAdmin seperate from the PostgreSQL installation (to overcome the fact that if you want to update pgAdmin you end up with two versions..... ). pgAdmin can be found at https://www.pgadmin.org/download/pgadmin-4-windows/ (pick the latest). Image Removed