문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top