0

When running psql <database_name> from the command line I've been getting this warning:

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.

I found a solution for this found from another question however it only gets rid of the warning for that session and I'm trying to completely get rid of the warning. It's been mentioned that I could go into C:\Program Files\PostgreSQL\9.6\scripts\runpsql.bat and cmd.exe /c chcp 1252 or chcp 1252 near the top of the batch file to remove this warning, however that has not been working for me.

When executing the batch file, it does print out a line console code page and the warning doesn't appear. However when I run psql [database] from the command prompt, the warning still persists. Does anyone know how to permanently remove the warning?

I am using PostgreSQL 9.6.1 and Windows 7 64-bit.

Community
  • 1
  • 1
user2361174
  • 1,872
  • 4
  • 33
  • 51

1 Answers1

0

Look here: psql: Init files?

You can locate the file PSQLRC.CONF and add in it a line like, perhaps,
\set ENCODING "whatever encoding you want"

Community
  • 1
  • 1
  • I haven't been able to find `postgresql\ ` nor `psqlrc.conf` in my AppData directory – user2361174 Dec 27 '16 at 10:45
  • Try searching from the root. `CD \ & DIR /S /B psqlrc.conf`. If it could be on a different "drive letter," change to that drive and repeat. – lit Dec 27 '16 at 13:57
  • `File not found.` on my C drive. I don't think there in my other drives since I never touch them (Recovery, Tools & MS Word), I don't even know how to access the terminal for them. – user2361174 Dec 28 '16 at 08:49
  • If the file does not exist, it can be created... but a deep look at the docs for psql must be made. – linuxfan says Reinstate Monica Dec 28 '16 at 14:14