我设置了psqlrc.conf文件,如下所示,但psql控制台输出看起来很奇怪,有不可读的单词。有谁知道我的psqlrc.conf文件有什么问题?我是否需要在命令行中将环境设置为utf-8,例如SET PGCLIENTENCODING=utf-8
?
**Here is psqlrc.conf file:**
\set ON_ERROR_STOP on
\set HISTCONTROL ignoredups
\set COMP_KEYWORD_CASE upper
\set VERBOSITY verbose
-- Output Fomatting
\x auto
\pset linestyle unicode
\pset border 2
\pset format wrapped
\pset pager off
\timing
**Here is psql console output:**
INSERT 0 87
Time: 613.572 ms
┌─[ RECORD 1 ]───┬──────â”
│ time │ 727 │
│ demo_groups │ 6 │
│ row_count │ 2124 │
├─[ RECORD 2 ]───┼──────┤
│ time │ 728 │
│ demo_groups │ 6 │
│ row_count │ 2125 │
├─[ RECORD 3 ]───┼──────┤
答案 0 :(得分:0)
使用
检查您的编码postgres=> \set
AUTOCOMMIT = 'on'
PROMPT1 = '%/%R%# '
PROMPT2 = '%/%R%# '
PROMPT3 = '>> '
VERBOSITY = 'default'
VERSION = 'PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 64-bit'
DBNAME = 'postgres'
USER = 'postgres'
PORT = '5432'
ENCODING = 'WIN1252'
更改变量ENCODING
\set ENCODING