postgreSQL 13.2 クライアントのエンコーディングを変更する方法

2022年12月14日

環境
Windows 10 Home 64bit
PostgreSQL 13.2

構文
show client_encoding
クライアントのエンコーディングを確認します。

使用例
1.エンコーディングを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# show client_encoding;
client_encoding
-----------------
SJIS
(1)
postgres=# show client_encoding; client_encoding ----------------- SJIS (1 行)
postgres=# show client_encoding;
 client_encoding
-----------------
 SJIS
(1 行)

2.エンコーディングを変更します。
書式
set client_encoding to 文字コード

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# set client_encoding to UTF8;
SET
postgres=# show client_encoding;
client_encoding
-----------------
UTF8
(1)
postgres=# set client_encoding to UTF8; SET postgres=# show client_encoding; client_encoding ----------------- UTF8 (1 行)
postgres=# set client_encoding to UTF8;
SET
postgres=# show client_encoding;
 client_encoding
-----------------
 UTF8
(1 行)

 

PostgreSQL

Posted by arkgame