failed to load sql modules into the database cluster

I have attempted to install PostgreSQL 9.4 and 8.4 multiple times and it is failing no matter what I have tried. I am attempting to install on Windows 7 SP1 x64. After each failed install I have uninstalled and deleted the installation folder to start fresh.

Each time I attempt the install I get an error pop up near the end of installation that says: "failed to load sql modules into the database cluster".

Then another error pop up displays immediately after that says: "Error running post install step. Installation may not complete correctly. Error reading C:/Program Files/PostgreSQL/9.4/postgresql.conf"

I have attempted installation with the following actions:

  • Always installed as administrator
  • Turned off all virus protection and windows firewall
  • Changed the installation directory to something other than the Program Files directory.
  • Changed the data directory to something other than the installation directory of postgres

None of the actions above have helped and I always receive the error. Any help that someone can provide would be greatly appreciated!

share improve this question
 
 
Please, per the Windows installation troubleshooting guide, get your installer log and post it here or upload it somewhere and link to it. wiki.postgresql.org/wiki/Troubleshooting_Installation –  Craig Ringer  Jun 7 '15 at 11:15
 
I am having the same problem on Windows 10 Pro x64 when trying to install PostgreSQL 9.4.4 x64. I installed VS 2015 Enterprise first; could the version of .Net framework have something to do with it? Did you ever figure out a solution to this? –  Jeff G  Aug 1 '15 at 2:55
 
@CraigRinger For me, the error in the installer log is: [20:49:14] Installing the adminpack module in the postgres database... Executing C:/Program Files/PostgreSQL/9.4\bin\psql.exe -c "CREATE EXTENSION adminpack" -d postgres Script exit code: 2 Script output: Script stderr: psql: could not connwind could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? Failed to load SQL modules into the database cluster. –  Jeff G  Aug 3 '15 at 22:45 
 
@CraigRinger When I ran the installer after disabling both Windows Defender and Windows Firewall, I received the same error message, but the installer also tried the IPv6 version of localhost (::1) before trying IPv4 localhost (127.0.0.1). Otherwise, the two error messages were identical. –  Jeff G  Aug 3 '15 at 23:50
 
@JeffG Sounds like the server didn't start correctly after install and initdb. Check the server logs in the %PROGRAMFILES%\PostgreSQL\9.4\data\pg_log directory. –  Craig Ringer  Aug 4 '15 at 0:09

5 Answers

up vote 5 down vote accepted

I was getting this same error when trying to install PostgreSQL v9.4.4 on Windows 10 Pro. Starting with a solution hosted on Stack Exchange, I came up with the following steps that allowed the installer to run successfully:

1) Create a new user account, called postgres
2) Add the new account to the Administrators and Power Users groups
3) Restart the computer
    NOTE: I added step #3, since step #4 didn't work without it
4) Run a command prompt as the postgres user, using the command:
    runas /user:postgres cmd.exe
5) Run the installer from the postgres command window
6) Delete the postgres user account, as well as the user directory
    NOTE: I added step #6, since the postgres account is not required after installation

share improve this answer
 
 
NOTE: I only ran into this issue because I followed the instructions to change the location of the Users directory on Windows 10. After many attempts at setting this up, I came to the conclusion that it messes up enough installers (Microsoft's Web Installer, .NET 3.5, Azure SDK, Postgres, others) that it wasn't worth it. When I installed Windows 10 normally, I had no issues. –  Jeff G  Aug 6 '15 at 18:04 
 
I am not sure if it was because I just installed Windows 10 or because I followed your instructions but I got the install to work finally. Thanks! –  John Theuerkauf  Aug 9 '15 at 18:48
  • Changed the data directory to something other than the installation directory of postgres

Make sure NETWORK SERVICE has read/write permissions on that folder, the installation was failing for me until I did this.

share improve this answer
 

What worked for me is, during the install, specifying a Postgre SQL data folder that's outside of any Windows user profile directory (C:\Users), such as C:\postgres-data.

My setup:

  • Win 10 Pro

  • PostgreSQL 9.5 RC1

I ran into this issue when I tried setting PostgreSQL's data directory somewhere under my user profile's directory, such us somewhere under "My Documents".

I tried Jeff G's solution and it didn't work at first. It worked only when I kept the data directory as the default (C:\Program Files\PostgreSQL\9.5\data). So then I tested further and tried setting the data directory to somewhere outside of any user profile directories (i.e. somewhere that isn't under C:\Users). For example, C:\postgres-data and this worked.

I then just tried using that directory with my default user, and not bothering with the postgres temp user as outlined in Jeff G's solution and that also worked. So in the end, it had to do with my data directory being somewhere under C:\Users. As long as it was outside of that, it worked.

share improve this answer
 

I had the same problem before. I solved this by installing Visual Studio C++ Express first.

share improve this answer
 

Encountered a very similar problem that OP is reporting today while installing Postgres 9.4.

It turns out that the password generator I was using has made a password that contains non-alphanumeric characters. ("^") I believe was the culprit in this case. Removing that allowed the installation of Postgres 9.4 (Windows 64 bit) to complete.

Very easy fix once you've found it, but the error message that comes up is not descriptive, so in this case I didn't notice at first what I was doing wrong.

share improve this answer
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值