Problems Installing PostgreSQL 9.2

前端 未结 11 1716
野趣味
野趣味 2020-12-15 12:05

I\'ve been trying to install the 64bit version of PostgreSQL 9.2 for Windows on my machine (Windows 7 64bit) and get this error:

The environment variable COMPS

11条回答
  •  余生分开走
    2020-12-15 12:51

    I'm running Windows Server 2003 R2, and I have been unable to resolve this problem with the installer, so I resorted to using the binary PostgreSQL package. Hopefully this will be an alternative for others who do not want to perform an OS reinstall.

    First, some background (hopefully useful to the developers)

    It started out with the postgres service failing to start (the server had been running reliably for over a year). I assumed it was a corrupted PostgreSQL installation, so I uninstalled and attempted to reinstall. I encountered the following error:

    There has been an error.
    The environment variable COMSPEC does not seem to point to the cmd.exe or there is a trailing semicolon present.
    Please fix this variable and restart installation.
    

    However, the COMSPEC variable is set properly, verified with:

    echo %COMSPEC%
    C:\WINDOWS\system32\cmd.exe
    

    and:

    "%COMSPEC%" /C "echo test ok"
    test ok
    

    Since this is Windows Server 2003, there is no UCA wrapper around the Administrator account, so that is not causing the problem.

    Manual Installation

    NET USER postgres /ADD
    
    C:\pgsql\bin\initdb.exe -U postgres -A password -E utf8 -W -D C:\pgsql\data
    
    runas /user:postgres "C:\pgsql\bin\pg_ctl -D C:/pgsql/data -l C:/pgsql/logfile.txt start"
    

提交回复
热议问题