Home postgresql When using Postgres through the console, Russian characters

When using Postgres through the console, Russian characters

Author

Date

Category

Recently, accidentally deleted environment variables when added a new variable. Previously used the “CHCP 1251” command and everything worked well, Russian characters were perfectly displayed. After removing environment variables, everything is displayed as on the screen. Variables of the environment added back, those that use those that should be by default. But apparently need some other way.
Tell me, please, if anyone came across a similar problem that you need to add or how to cope with a similar problem.


Answer 1, Authority 100%

Try Run:

psql -d YourBase -u YourLogin

and set the encoding:

set client_encoding = 'win1251';

Answer 2, Authority 100%

The question was solved by adding some environment variables that were absent from me. I looked at my colleagues on my computer and added.
Next, executed instructions from here https://iu5bmstu.ru/index.php/postgreSQL_-_% D0% 9A% D0% B8% D1% 80% D0% B8% D0% BB% D0% BB% D0% B8% D1% 86% D0% B0_% D0% B2_PSQL_% D0% BF% D0% BE% D0% B4_Windows
As a result, everything worked as before.
Good luck to all. Do not remove your environment variables like me)))))


Answer 3

from psql -client coding “win1251” can be installed by the command:

\! CHCP 1251.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions