Postgres “psql not recognized as an internal or external command”

前端 未结 10 1731
南方客
南方客 2021-02-02 06:07

For Postgres, I keep getting this error multiple times even though I have already set the location of the bin folder to the path variable in Windows 8. Is there something else I

相关标签:
10条回答
  • 2021-02-02 06:31

    Make sure that the path actually leads to the executables. I'm using version 11 and it did not work until this was set as the path:

    C:\Program Files\PostgreSQL\11\bin\bin

    Maybe this is how version 11 is structured or I somehow botched the installation but I haven't had a problem since.

    0 讨论(0)
  • 2021-02-02 06:36

    Enter this path in your System environment variable.

    C:\Program Files\PostgreSQL\[YOUR PG VERSION]\bin
    

    In this case i'm using version 10. If you check the postgres folder you are going to see your current versions.

    In my own case i used the following on separate lines:

    C:\Program Files\PostgreSQL\10\bin
    C:\Program Files\PostgreSQL\10\lib
    
    0 讨论(0)
  • 2021-02-02 06:38

    Always better to install a previous version or in the installation make sure you specify the '/data' in a separate directory folder "C:\data"

    0 讨论(0)
  • 2021-02-02 06:40

    Windows 10

    It could be that your server doesn't start automatically on windows 10 and you need to start it yourself after setting your Postgresql path using the following command in cmd:

    pg_ctl -D "C:\Program Files\PostgreSQL\11.4\data" start
    

    You need to be inside "C:\Program Files\PostgreSQL\11.4\bin" directory to execute the above command.

    EX:

    You still need to be inside the bin directory to work with psql

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