Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

I think it is OK to check the supported client encoding by the following SQL query.

SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding)
from pg_catalog.pg_conversion;
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top