Search code examples
windowspostgresqlpsql

psql "more is not recognized" error


I am using the postgresql (9.4) interactive terminal psql on Windows 8.1 (64 bit). After installing and creating a database and table and inserting data into a row I want to view the data.

However, when I type

SELECT * FROM my_table;

I get an error:

'more' is not recognized as an internal or external command, operable program or batch file.

After adding "C:\Windows\System32;" to my path variable, more works in Powershell (e.g. more hello.txt) but still not in psql.

What else do I need to do to make the SELECT statement work?


Solution

  • It sounds like the way you are launching psql, C:\Windows\System32 is not actually on the PATH in the resulting environment.

    You can download something like Process Explorer and use it to look at the environment variables for the running psql process and see if that path is present.

    If not, you could make sure it's set in the shell from which psql is invoked, set it as a system environment variable, set PATH accordingly in a cmd file and then invoke psql, etc.

    set PATH=%PATH%;C:\Windows\System32