I am trying to upgrade an installer created with NSIS that installs postgresql. It used to install postgresql 8.3 but we want to upgrade the DB to 9.4.4.

The old version on of the DB used to be an MSI installer but they have switched to a Windows EXE with the later version. The old version was able to install over a existing installation. The new version breaks and gives me a very general error that I can't use to pinpoint the issue.


The installation directory must be an absolute path, containing only letters, numbers and the characters '-', '/', '.' and '_', and must be writable.

This is my install command:

postgresql-9.4.4-1-windows-x64.exe --prefix "C:\postgres" --datadir "C:\postgres\data" --enable_acledit 1 --install_runtimes 0 --serverport 5432 --superpassword "XXXX" --servicepassword "XXXX" --unattendedmodeui minimal --mode unattended --debuglevel 0 --serviceaccount "postgres" --create_shortcuts 0

The Bitrock installer only provides the above error with no path detail or anything to act on.

Any clues or suggestions? (Thanks)

  • My requirements are to reinstall PG without having to Uninstall first. Commented Jun 22, 2015 at 23:17
  • You realise you'll need to do a dump and restore of the data right? 8.3 is too old to support pg_upgrade. Commented Jun 22, 2015 at 23:52
  • Yes, I am not having issues with data but rather with the actual DB software. Commented Jun 23, 2015 at 0:35
  • 1
    Have you tried to follow the hint in the error and replace \ with /? See a related issue: dba.stackexchange.com/a/29773/6219 Commented Jun 23, 2015 at 12:26
  • Yes... I have replaced the "/" with no luck. I think it't pointing to a permission issue. Commented Jun 23, 2015 at 22:17

3 Answers 3


Actually I've found out the problem. At least at my end with the same error.

I was creating an installer for my software with NSIS and it uses the postgresql database, in order to use the postgresql silent install I previously installed it on the target machine to test which parameters I should use, after tested it successfully I then uninstalled it so it could be installed by my software.

Then problem appears when I run my installer and the same error shows:

The installation directory must be an absolute path, containing only letters, numbers and the characters '-', '/', '.' and '_', and must be writable.

I start to test everything from users, to user permissions, folder permissions, length of folder names.

Then I went to windows registry and found out the my first installation of postgresql left some registries for it even though I uninstalled it from the control panel also it left the postgres user on the machine.

So I delete all postgresql (Edit->find->postgresql) entries from the registry and also deleted the Windows user (postgres) and then everithing works great.

The only problem now is how to do it through the NSIS program.

Hope it helps.


Upgrading a PostgreSQL Cluster

Postgres official documentation

I've only ever migrated using pg_dump and pg_restore, which is perfectly acceptable, but the docs also refer you to methods which involve pg_dumpall, pg_upgrade, or via replication.

In general you want to apply one of these approaches since the data format used in successive versions is subject to change.

  • Hi Chris, I am actually not migrating. I am talking about having 9.4,.4 installed and then reinstalling 9.4.4 without uninstalling the old files. (Installing 9.4.4 over 8.4 is not allowed in my installer and requires a pd_dump,uninstall,new installer and pg_restore process) Commented Jun 22, 2015 at 23:16
  • 1
    Sorry then, I must have misunderstood the problem, and thought it was an upgrade problem. So then, looking at your error, have you tried altering the install command to use '/' instead of '\'? That is, --prefix "C:/postgres" --datadir "C:/postgres/data"? Just a shot in the dark.
    – Chris
    Commented Jun 22, 2015 at 23:34
  • Well Spotted Chris, but no cigar... Still not happy making me think its a privileges issue. Commented Jun 22, 2015 at 23:54

Here is what I discovered...I hope it helps someone: When supplying the directory arguments to the postgres installer command line, do not encapsulate the paths in double quotes. To succeed with custom paths, ensure there are no spaces in the path names, and therefore no need for the double quotes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.