PgAdmin III, opening server status gives "invalid byte sequence for encoding UTF8" PgAdmin III, opening server status gives "invalid byte sequence for encoding UTF8" postgresql postgresql

PgAdmin III, opening server status gives "invalid byte sequence for encoding UTF8"


The problem you have is that the locale setting lc_messages is set to an encoding that is different to the encoding of the database(s). As a result, some messages are being written into the log using Windows-1252 encoding, while when you try to use PgAdmin to view the log, it tries to interpret the file using UTF-8. Some of the byte sequences written in the log are not valid UTF-8, leading to the error.

In fact, the way in which different locales interact in postgresql can result in mixed encodings in the log file. There is a Bug Report on this, but it does not look like it has been resolved.

Probably the easiest way to resolve this is to set lc_messages to English_United States.UTF-8.

It would also be preferable to have lc_messages aligned across all of the databases on the server (or at least all using the same encoding).

Be sure to remove any existing log files as they will already contain the incorrect encoding.


It is due to your postgresql.log corrupted as stated in the statement 'select pf_file_read ....'.

If you do a "touch" (after a backup of your log perhaps) on you server log, and reconnect, you'll not see this unicode error anymore and thus, you'll be able to use pgadmin III furthermore.