Change database encoding value for postgresql dataabse.

We can change database encoding values for postgresql database by using following steps but make sure that you have taken backup for current database.

Log in to server as root user and switch to postgres

su postgres –

To check all database run

psql -l

To switch database for example we are using support_test

psql -d support_test

Run command to check encoding

SET CLIENT_ENCODING TO ‘LATIN1’;
or
SET NAMES ‘LATIN1’;

Now check encoding

support_test=# SHOW client_encoding;
client_encoding

—————–
LATIN1
(1 row)

About Anant 384 Articles
Senior technical writer