PostgreSQL – How to List All Available Encoding Types

character-setencodingpostgresqlunicode

SELECT datname, pg_encoding_to_char(encoding) 
FROM pg_database;

…lists all the databases, each with its encoding type.

However, I am trying to find out what are all the encoding types available in the PostgreSQL server. Can I query for all available encoding types?

Or are the only encoding types ever available listed in Chapter 23.3 Character Set Support?

Best Answer

Or are the only encoding types ever available listed in Chapter 23.3 Character Set Support?

Yes. You can see the full list in the source code, if you insist

That said, it's highly abnormal to use any of these encoding except UTF-8 as an internal storage format. Unicode should support all of the useful characters in all of the other encodings. If you find UTF-8 acceptable, the only purpose these other encoding serve is to eliminate the need to create an ETL script for the COPY statement.