1

Whenever I access psql, I get the following message:

psql (9.6.2)
WARNING: Console code page (437) differs from Windows code page (1252)
     8-bit characters might not work correctly. See psql reference
     page "Notes for Windows users" for details.
Type "help" for help.

postgres=#

I tried command

cmd.exe /c chcp 1252

before running runpsql.bat file in command line. And there, it runs fine without the error. But accessing psql again after closing command prompt, throws the same warning. How do I solve this warning within SQL Shell?

I am using windows 10 OS.

Edit:

This is what I did:

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Sarthak Joshi>E:

E:\>cd PostgreSQL

E:\PostgreSQL>cd scripts

E:\PostgreSQL\scripts>chcp 1252
Active code page: 1252

E:\PostgreSQL\scripts>runpsql.bat
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (9.6.2)
Type "help" for help.

postgres=#

But after exiting from cmd, and firing up shell like this:

Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (9.6.2)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=#

It still throws the same warning...

3

When you use cmd.exe /c chcp 1252 in the batch file, you start a new command line, change the codepage for that and then that command line is immediately terminated, but the one that runs psql has not bee changed.

Just put:

chcp 1252

(without calling cmd.exe) into the batch file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.