Problems Installing PostgreSQL 9.2

前端 未结 11 1678
野趣味
野趣味 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:42

    What worked for me after trying to enter the commandline given her in cmd.exe I found it was named cmd1.exe in system32.. so i copied the file and renamed it as cmd.exe and installation finished

    0 讨论(0)
  • 2020-12-15 12:44

    ComSpec is a generic error message for any installation failure.

    Identifying the problem

    1. Navigate to below path c:\Users\XXXXXX\AppData\Local\Temp
    2. Open 'bitrock_installer_XXXX.log'
    3. Check, if you are getting below error:

    Script stderr: '"C:\Users\XXXXX\AppData\Local\Temp\POSTGR~1\TEMP_C~1.BAT"' is not recognized as an internal or external command, operable program or batch file.

    Error running

    C:\Users\XXXXX\AppData\Local\Temp/postgresql_installer_47b21c4ea1/temp_check_comspec.bat :
    '"C:\Users\XXXXX\AppData\Local\Temp\POSTGR~1\TEMP_C~1.BAT"' is not recognized as an internal or external command,

    operable program or batch file.

    This is a problem with '8.3 file names and directories' (e.g. '\Postgres Install' -> '\POSTGR~1') Microsoft article on disabling 8.3 file names and directories: https://support.microsoft.com/en-gb/kb/121007

    Solution:

    1. Open command prompt in admin mode
    2. Execute following command to change the format based on your drive or all drives

      Sample commands:

      fsutil 8dot3name set 1"      - disable 8dot3 name creation on all volumes
      fsutil 8dot3name set C: 1"   - disable 8dot3 name creation on c:
      
    3. Execute the installation as a user having admin privileges

    4. After install, consider resetting the 8dot3name setting to default (2) to avoid unintended consequences

    Hope it solves the problem!

    0 讨论(0)
  • 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"
    
    0 讨论(0)
  • 2020-12-15 12:54

    just do it run as administrator and change the environment system variable like create a new variable 'ComSpec' and value type 'C:\Windows\system32\cmd.exe'.

    0 讨论(0)
  • 2020-12-15 12:55

    If the installer exe is on a network share that mapped drive might actually not be accessible to the installer as it runs as administrator. This can often happen in some virtual machine arrangements such as running windows in a parallels VM. Copy the installer to a local drive first and you won't have a problem.

    0 讨论(0)
  • 2020-12-15 13:00

    It's not COMPSPEC it's just COMSPEC. Please show the output of:

    echo %COMSPEC%
    

    Note that COMSPEC could be set to something different in the Administrator account you're running the installer as. I'm not sure how to find that out, but it might appear in the PostgreSQL installer log, so please upload that and link to it in your post. See Reporting an installation error for info on where to get the installer log.

    See the PostgreSQL for Windows FAQ entry Check the COMSPEC environment variable.

    Here's a report I made suggesting that the installer should test for this explicitly and here's my blog post on the topic.

    0 讨论(0)
提交回复
热议问题