I am trying to set client encoding for a session. I am running the following command on linux terminal (postgresql installed on a remote server.
psql -h localhost -p 5432 -U user -d dbase -c "SET client_encoding to 'LATIN1';"
Output: SET
psql -h localhost -p 5432 -U user -d dbase -c "show client_encoding"
Output: UTF8
Why is this happening? Do I need to run this command as a superuser? (I don't think so)
If I run the following commands on Pgadmin4 then it correctly show LATIN1 as the output.
SET client_encoding to 'LATIN1'
show client_encoding
The server encoding is set to UTF8.
SET client_encoding to 'LATIN1';is not persistent, it is only set for the current session/connection.