0

我将 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 ]───┼──────┤
4

1 回答 1

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'

更改变量编码

\set ENCODING
于 2014-05-23T20:24:08.700 回答