[英]psql: FATAL: invalid value for parameter “client_encoding”: “WIN1252”
I am using psql with Redshift. 我在Redshift中使用psql。 Unfortunately, Redshift is uses PostgreSQL 8.0.2.
不幸的是,Redshift使用的是PostgreSQL 8.0.2。 So when I downloaded the latest version of PostgreSQL (9.6.1) and try logging into a database, I get the error:
因此,当我下载最新版本的PostgreSQL(9.6.1)并尝试登录数据库时,出现错误:
cannot connect from psql due to invalid parameter "client_encoding"
Instructions here https://forums.aws.amazon.com/thread.jspa?messageID=529120 suggest 此处的指示https://forums.aws.amazon.com/thread.jspa?messageID=529120建议
set PGCLIENTENCODING=UTF8
But when I open SQL Shell (psql) in Windows, I am never given the chance to enter this command: 但是,当我在Windows中打开SQL Shell(psql)时,再也没有机会输入以下命令:
How can I bridge this gap/fix this error? 如何弥合此差距/解决此错误? Thanks
谢谢
set x=y
is the Windows CMD syntax to set an environment variable , just as x=y;export x
or export x=y
or setenv xy
is on most Unix shells. set x=y
是Windows CMD语法来设置环境变量 ,就像x=y;export x
大多数Unix shell上都使用x=y;export x
或export x=y
或setenv xy
。
You can pre-set a (semi)permanent env var in Windows from ControlPanel / System (or ThisPC rightclick Properties), AdvancedSystemSettings, Advanced tab, EnvironmentVariables button. 您可以在Windows中通过ControlPanel /系统(或ThisPC右键单击“属性”),“ AdvancedSystemSettings”,“高级”选项卡,“ EnvironmentVariables”按钮预先设置一个(半)永久环境。 Or from CMD with the
SETX
command; 或使用
SETX
命令从CMD获得; SETX /?
for help or http://ss64.com/nt/setx.html . 寻求帮助或http://ss64.com/nt/setx.html 。 (Or directly in the registry, but if you have enough skill to use regedit safely you wouldn't ask this Q.)
(或者直接在注册表中,但是如果您有足够的技能安全地使用regedit,则不会问这个问题。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.