PostgreSQL:警告:控制台代码页(437)不同于Windows代码页(1252) [英] PostgreSQL: Warning: Console code page (437) differs from Windows code page (1252)

查看:954
本文介绍了PostgreSQL:警告:控制台代码页(437)不同于Windows代码页(1252)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用PostgreSQL数据库SQL提示符中的 \c testdb 时,使用 PostgreSQL 连接到数据库。我成功连接到db,但收到以下警告:

Using PostgreSQL when I connect to a db using \c testdb inside PostgreSQL Database SQL Prompt. I successfully connect to the db but getting the following warning:

postgres-# \c testdb
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.
You are now connected to database "testdb" as user "postgres".
testdb-#

此警告是什么意思?如何解决?

What does this warning mean? How to resolve it?

推荐答案

psql文档


psql是作为控制台应用程序构建的。由于Windows控制台
Windows使用与系统其他部分不同的编码,因此在psql中使用8位字符时,必须特别小心
。如果psql
检测到有问题的控制台代码页,它会在启动时发出警告。

psql is built as a "console application". Since the Windows console windows use a different encoding than the rest of the system, you must take special care when using 8-bit characters within psql. If psql detects a problematic console code page, it will warn you at startup.

要更改控制台代码页,有两件事是必要的:
通过输入cmd.exe / c chcp 1252设置代码页(1252是适用于德语的代码
页面;用您的值替换。)如果
使用Cygwin,则可以将此命令放在/ etc / profile中。

To change the console code page, two things are necessary: Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code page that is appropriate for German; replace it with your value.) If you are using Cygwin, you can put this command in /etc/profile.

因此要删除该警告,需要执行 chcp 1252 ,然后再输入 psql 。使用不带参数的 chcp 可以提供当前代码页。

So to remove that warning you need to execute chcp 1252 before you enterpsql. Using chcp without parameters gives you the current codepage.

这篇关于PostgreSQL:警告:控制台代码页(437)不同于Windows代码页(1252)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆