pgsql-general
❮
List of encodings
- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 18, 2026, 6:46 AM UTCHi, ALL,
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
Or is it hard coded inside the PostgreSQL codebase?
Thank you.- Jump to comment-1David G. Johnston<david.g.johnston@gmail.com>Apr 18, 2026, 7:19 AM UTCOn Friday, April 17, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
This wouldn’t be under the purview of information schema. You can find
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#
MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
pg-specific pieces though:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
Note the function used to convert ids to names.
Yes. Doesn’t preclude exposing it via SQL but we don’t do so directly.
Or is it hard coded inside the PostgreSQL codebase?
David J.- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 19, 2026, 8:28 PM UTCHi, David,
On Sat, Apr 18, 2026 at 2:19 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:On Friday, April 17, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
Tried the following query:
This wouldn’t be under the purview of information schema. You can find pg-specific pieces though:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
Note the function used to convert ids to names.
and got following results (for simplicity I will post only couple of rows):SELECT conname AS name, pg_encoding_to_char( conforencoding ) AS encoding, condefault AS default FROM pg_conversion ORDER BY encoding;
What I noticed is that all encodings are default, as they all have 't'big5_to_utf8 | BIG5 | t big5_to_euc_tw | BIG5 | t big5_to_mic | BIG5 | t euc_cn_to_mic | EUC_CN | t euc_cn_to_utf8 | EUC_CN | t euc_jis_2004_to_shift_jis_2004 | EUC_JIS_2004 | t euc_jis_2004_to_utf8 | EUC_JIS_2004 | t euc_jp_to_mic | EUC_JP | t euc_jp_to_sjis | EUC_JP | t euc_jp_to_utf8 | EUC_JP | t euc_kr_to_utf8 | EUC_KR | t euc_kr_to_mic | EUC_KR | t euc_tw_to_big5 | EUC_TW | t euc_tw_to_utf8 | EUC_TW | t euc_tw_to_mic | EUC_TW | t
in the last column.
It's a little confusing...
Thx for the help.
Or is it hard coded inside the PostgreSQL codebase?
Yes. Doesn’t preclude exposing it via SQL but we don’t do so directly.
David J.- Jump to comment-1Adrian Klaver<adrian.klaver@aklaver.com>Apr 19, 2026, 9:21 PM UTCOn 4/19/26 1:27 PM, Igor Korot wrote:
Hi, David,
On Sat, Apr 18, 2026 at 2:19 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:On Friday, April 17, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
This wouldn’t be under the purview of information schema. You can find pg-specific pieces though:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
Note the function used to convert ids to names.
Tried the following query:
SELECT conname AS name, pgencodingto_char( conforencoding ) ASencoding, condefault AS default FROM pg_conversion ORDER BY encoding;
and got following results (for simplicity I will post only couple of rows):
big5toutf8 | BIG5 | tbig5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
euccntomic | EUCCN | t
euccntoutf8 | EUCCN | t
eucjis2004toshiftjis2004 | EUCJIS2004 | t
eucjis2004toutf8 | EUCJIS2004 | t
eucjptomic | EUCJP | t
eucjptosjis | EUCJP | t
eucjptoutf8 | EUCJP | t
euckrtoutf8 | EUCKR | t
euckrtomic | EUCKR | t
euctwtobig5 | EUCTW | t
euctwtoutf8 | EUCTW | t
euctwtomic | EUCTW | tWhat I noticed is that all encodings are default, as they all have 't'
in the last column.
It's a little confusing...
Not if you read the docs:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
"The catalog pg_conversion describes encoding conversion functions. See CREATE CONVERSION for more information."
https://www.postgresql.org/docs/current/sql-createconversion.html
"Conversions that are marked DEFAULT can be used for automatic encoding conversion between client and server. To support that usage, two conversions, from encoding A to B and from encoding B to A, must be defined."Thx for the help.
Or is it hard coded inside the PostgreSQL codebase?
adrian.klaver@aklaver.com
Yes. Doesn’t preclude exposing it via SQL but we don’t do so directly.
David J.
-- Adrian Klaver- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 20, 2026, 12:19 AM UTCHi, Adrian,
On Sun, Apr 19, 2026 at 4:21 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 4/19/26 1:27 PM, Igor Korot wrote:Hi, David,
On Sat, Apr 18, 2026 at 2:19 AM David G. Johnston<david.g.johnston@gmail.com> wrote:
On Friday, April 17, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
This wouldn’t be under the purview of information schema. You can find pg-specific pieces though:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
Note the function used to convert ids to names.
Tried the following query:
SELECT conname AS name, pgencodingto_char( conforencoding ) AS
encoding, condefault AS default FROM pg_conversion ORDER BY encoding;
and got following results (for simplicity I will post only couple of rows):
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
euccntomic | EUCCN | t
euccntoutf8 | EUCCN | t
eucjis2004toshiftjis2004 | EUCJIS2004 | t
eucjis2004toutf8 | EUCJIS2004 | t
eucjptomic | EUCJP | t
eucjptosjis | EUCJP | t
eucjptoutf8 | EUCJP | t
euckrtoutf8 | EUCKR | t
euckrtomic | EUCKR | t
euctwtobig5 | EUCTW | t
euctwtoutf8 | EUCTW | t
euctwtomic | EUCTW | t
What I noticed is that all encodings are default, as they all have 't'
in the last column.
It's a little confusing...
Not if you read the docs:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
"The catalog pg_conversion describes encoding conversion functions. See
CREATE CONVERSION for more information."
https://www.postgresql.org/docs/current/sql-createconversion.html
"Conversions that are marked DEFAULT can be used for automatic encoding
conversion between client and server. To support that usage, two
conversions, from encoding A to B and from encoding B to A, must be
defined."- Jump to comment-1David G. Johnston<david.g.johnston@gmail.com>Apr 20, 2026, 12:42 AM UTCOn Sun, Apr 19, 2026 at 5:19 PM Igor Korot <ikorot01@gmail.com> wrote:
condefault bool
In theory a given pair of encodings could have more than one converter
True if this is the default conversion
installed. Only one of those many could be marked default.
David J.- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 20, 2026, 12:55 AM UTCHi, David,
On Sun, Apr 19, 2026 at 7:42 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:On Sun, Apr 19, 2026 at 5:19 PM Igor Korot <ikorot01@gmail.com> wrote:
condefault bool
True if this is the default conversion
I think you meant to stay "should", right?
In theory a given pair of encodings could have more than one converter installed. Only one of those many could be marked default.
"Only one should be marked default."
because if two of them are - and the user did not supply any - which
one the engine will use?
Thank you.
David J.
- Jump to comment-1Adrian Klaver<adrian.klaver@aklaver.com>Apr 20, 2026, 12:53 AM UTCOn 4/19/26 5:19 PM, Igor Korot wrote:
Hi, Adrian,
On Sun, Apr 19, 2026 at 4:21 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
What I noticed is that all encodings are default, as they all have 't'
in the last column.
It's a little confusing...
Not if you read the docs:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
"The catalog pg_conversion describes encoding conversion functions. See
CREATE CONVERSION for more information."
https://www.postgresql.org/docs/current/sql-createconversion.html
"Conversions that are marked DEFAULT can be used for automatic encoding
conversion between client and server. To support that usage, two
conversions, from encoding A to B and from encoding B to A, must be
defined."
From the https://www.postgresql.org/docs/current/catalog-pg-conversion.html:
[quote]
condefault bool
True if this is the default conversion[/quote]
So, what info do I trust?
Both.
In your setup all the installed encoding conversion functions are also the default for those conversions. It is possible to create/install a conversion function that is not the default.Thank you.
-- Adrian Klaver
adrian.klaver@aklaver.com- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 20, 2026, 1:13 AM UTCAdrian,
On Sun, Apr 19, 2026 at 7:53 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 4/19/26 5:19 PM, Igor Korot wrote:Hi, Adrian,
On Sun, Apr 19, 2026 at 4:21 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
What I noticed is that all encodings are default, as they all have 't'
in the last column.
It's a little confusing...
Not if you read the docs:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
"The catalog pg_conversion describes encoding conversion functions. See
CREATE CONVERSION for more information."
https://www.postgresql.org/docs/current/sql-createconversion.html
"Conversions that are marked DEFAULT can be used for automatic encoding
conversion between client and server. To support that usage, two
conversions, from encoding A to B and from encoding B to A, must be
defined."
From the https://www.postgresql.org/docs/current/catalog-pg-conversion.html:
[quote]
condefault bool
True if this is the default conversion
[/quote]
So, what info do I trust?
So, let's say I chose "BIG5"".
Both.
In your setup all the installed encoding conversion functions are also
the default for those conversions. It is possible to create/install a
conversion function that is not the default.
As stated the table contains:
Since all 3 are default character sets, which one would be chosen?big5_to_utf8 | BIG5 | t big5_to_euc_tw | BIG5 | t big5_to_mic | BIG5 | t
(in the context of CREATE DATABASE)
Thank you.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com- Jump to comment-1Ron Johnson<ronljohnsonjr@gmail.com>Apr 20, 2026, 1:32 AM UTCOn Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
In your setup all the installed encoding conversion functions are also
the default for those conversions. It is possible to create/install a
conversion function that is not the default.
Does CREATE DATABASE convert text? (I think you might be
So, let's say I chose "BIG5"".
As stated the table contains:
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)
misunderstanding the purpose of the pg_conversion table.)
Wouldn't it only convert text when a client is inserting text of encoding
X into a table with encoding Y?
ISTM that pg_conversion says whether PG knows how to convert from X to Y,
not the encoding scheme you defined when creating the db.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!- Jump to comment-1Tom Lane<tgl@sss.pgh.pa.us>Apr 20, 2026, 1:49 AM UTCRon Johnson <ronljohnsonjr@gmail.com> writes:
On Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01@gmail.com> wrote:
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)Does CREATE DATABASE convert text? (I think you might be
Indeed. I doubt that CREATE DATABASE references this catalog at all.
misunderstanding the purpose of the pg_conversion table.)Wouldn't it only convert text when a client is inserting text of encoding
In the current system structure, where conversion actually happens
X into a table with encoding Y?
is at the client interface, when sending/receiving data. All text
that's running around inside a backend process is expected to be
in the database's encoding, and we convert if the client has
declared that it wants to work in some other encoding. So the
pg_conversion catalog is actually consulted during connection
startup, to see if we can support the requested client_encoding
with the database encoding.
There is also the convert() function, which allows you to convert a
blob of text from one encoding to another --- but the input and output
are both declared as bytea, so that they don't have to be valid in the
current database encoding.
IIRC, the client conversion lookups will only choose "condefault"
conversions, so that a non-default conversion is only reachable via
convert(). So that feature is really pretty vestigial.regards, tom lane - Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 21, 2026, 2:42 AM UTCHi, ALL,
On Sun, Apr 19, 2026 at 8:32 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:On Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
In your setup all the installed encoding conversion functions are also
the default for those conversions. It is possible to create/install a
conversion function that is not the default.
So, let's say I chose "BIG5"".
As stated the table contains:
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)
No it does not.
Does CREATE DATABASE convert text? (I think you might be misunderstanding the purpose of the pg_conversion table.)
But it has an option that can be chosen and supplied to the command...
So when I write "CREATE DATABASE mydb ECODING = BIG5", what will happen?
Moreover, I'm curious - if I chose "BIG5", there are only number of
available collate/ctype pairs.
How do I choose which one to present to the user.
Because there is not one default "BIG5" - there are 3 default "BIG5"s.
Thank you.
Wouldn't it only convert text when a client is inserting text of encoding X into a table with encoding Y?
ISTM that pg_conversion says whether PG knows how to convert from X to Y, not the encoding scheme you defined when creating the db.
--Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 21, 2026, 2:47 AM UTCMy understanding is that if I have 3 "BIG5" encodings, only one can be
a default.
And if you want you can choose the other 2, but selecting "BIG5" will
make only one
to be selected by default.
That is why it is called "default" ;-)
Thank you.
On Mon, Apr 20, 2026 at 7:42 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,On Sun, Apr 19, 2026 at 8:32 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
In your setup all the installed encoding conversion functions are also
the default for those conversions. It is possible to create/install a
conversion function that is not the default.
So, let's say I chose "BIG5"".
As stated the table contains:
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)
Does CREATE DATABASE convert text? (I think you might be misunderstanding the purpose of the pg_conversion table.)
No it does not.
But it has an option that can be chosen and supplied to the command...
So when I write "CREATE DATABASE mydb ECODING = BIG5", what will happen?
Moreover, I'm curious - if I chose "BIG5", there are only number of
available collate/ctype pairs.
How do I choose which one to present to the user.
Because there is not one default "BIG5" - there are 3 default "BIG5"s.
Thank you.
Wouldn't it only convert text when a client is inserting text of encoding X into a table with encoding Y?
ISTM that pg_conversion says whether PG knows how to convert from X to Y, not the encoding scheme you defined when creating the db.
--Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
- Jump to comment-1Ron Johnson<ronljohnsonjr@gmail.com>Apr 21, 2026, 2:55 AM UTCIgor,
pg_conversion is for when you convert text. Why does it matter if you
never convert text?
On Mon, Apr 20, 2026 at 10:47 PM Igor Korot <ikorot01@gmail.com> wrote:My understanding is that if I have 3 "BIG5" encodings, only one can be
a default.
And if you want you can choose the other 2, but selecting "BIG5" will
make only one
to be selected by default.
That is why it is called "default" ;-)
Thank you.On Mon, Apr 20, 2026 at 7:42 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,On Sun, Apr 19, 2026 at 8:32 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:
On Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
In your setup all the installed encoding conversion functions arealso
the default for those conversions. It is possible to create/install
a
conversion function that is not the default.
So, let's say I chose "BIG5"".
As stated the table contains:
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)
Does CREATE DATABASE convert text? (I think you might bemisunderstanding the purpose of the pg_conversion table.)
No it does not.
But it has an option that can be chosen and supplied to the command...
So when I write "CREATE DATABASE mydb ECODING = BIG5", what will happen?
Moreover, I'm curious - if I chose "BIG5", there are only number of
available collate/ctype pairs.
How do I choose which one to present to the user.
Because there is not one default "BIG5" - there are 3 default "BIG5"s.
Thank you.
Wouldn't it only convert text when a client is inserting text ofencoding X into a table with encoding Y?
ISTM that pg_conversion says whether PG knows how to convert from X toY, not the encoding scheme you defined when creating the db.
--Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster! - Jump to comment-1David G. Johnston<david.g.johnston@gmail.com>Apr 21, 2026, 3:29 AM UTCOn Mon, Apr 20, 2026 at 7:47 PM Igor Korot <ikorot01@gmail.com> wrote:
My understanding is that if I have 3 "BIG5" encodings, only one can be
That would be a misunderstanding of what a conversion table is about.
a default.
David J.- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 21, 2026, 4:22 AM UTCHi, everybody,
On Mon, Apr 20, 2026 at 8:29 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:On Mon, Apr 20, 2026 at 7:47 PM Igor Korot <ikorot01@gmail.com> wrote:
My understanding is that if I have 3 "BIG5" encodings, only one can be
a default.
What I did:
That would be a misunderstanding of what a conversion table is about.
1. Google "PostgreSQL create database"
2. Click the first link - to PostgreSQL documentation.
3. The command have many options. One of them is "Encoding".
4, Scrolled down for an explanation. The explanation had a link.
5. Clicked the link. Received a page with the list of encodings.
At this point I asked the original question
Does the list on that page stored somewhere? Or it is hardcoded inside
the sources?
That's when I started receiving a references to that table.
Did I ask the wrong question?
Thank you.
David J.- Jump to comment-1David G. Johnston<david.g.johnston@gmail.com>Apr 21, 2026, 4:32 AM UTCOn Monday, April 20, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, everybody,
On Mon, Apr 20, 2026 at 8:29 PM David G. Johnston<david.g.johnston@gmail.com> wrote:
On Mon, Apr 20, 2026 at 7:47 PM Igor Korot <ikorot01@gmail.com> wrote:
My understanding is that if I have 3 "BIG5" encodings, only one can be
a default.
That would be a misunderstanding of what a conversion table is about.
And the answer you got was “no, it’s not (i.e., it’s hardcoded inside), but
What I did:
1. Google "PostgreSQL create database"
2. Click the first link - to PostgreSQL documentation.
3. The command have many options. One of them is "Encoding".
4, Scrolled down for an explanation. The explanation had a link.
5. Clicked the link. Received a page with the list of encodings.
At this point I asked the original question
Does the list on that page stored somewhere? Or it is hardcoded inside
the sources?
That's when I started receiving a references to that table.
Did I ask the wrong question?
you can get to it indirectly”. In this case if you involve the
pgconversion table you should ignore the conversion is default field as it
has nothing to do with the question - what encodings does the system
recognize. You also got an answer involving generate_series.
David J.- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 21, 2026, 4:58 AM UTCDavid,
On Mon, Apr 20, 2026 at 9:32 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:On Monday, April 20, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, everybody,
On Mon, Apr 20, 2026 at 8:29 PM David G. Johnston<david.g.johnston@gmail.com> wrote:
On Mon, Apr 20, 2026 at 7:47 PM Igor Korot <ikorot01@gmail.com> wrote:
My understanding is that if I have 3 "BIG5" encodings, only one can be
a default.
That would be a misunderstanding of what a conversion table is about.
What I did:
1. Google "PostgreSQL create database"
2. Click the first link - to PostgreSQL documentation.
3. The command have many options. One of them is "Encoding".
4, Scrolled down for an explanation. The explanation had a link.
5. Clicked the link. Received a page with the list of encodings.
At this point I asked the original question
Does the list on that page stored somewhere? Or it is hardcoded inside
the sources?
That's when I started receiving a references to that table.
Did I ask the wrong question?
Understood, thx. This clears it up.
And the answer you got was “no, it’s not (i.e., it’s hardcoded inside), but you can get to it indirectly”. In this case if you involve the pgconversion table you should ignore the conversion is default field as it has nothing to do with the question - what encodings does the system recognize. You also got an answer involving generate_series.
Sorry for the confusion.
And yes - I will query the pg_conversion table.
Thx once again.
David J.
- Jump to comment-1Peter J. Holzer<hjp-pgsql@hjp.at>Apr 20, 2026, 5:54 AM UTCOn 2026-04-19 20:13:29 -0500, Igor Korot wrote:
So, let's say I chose "BIG5"".
Note that the table contains two encodings (conforencoding and
As stated the table contains:
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
Since all 3 are default character sets, which one would be chosen?
(in the context of CREATE DATABASE)
contoencoding) for each conversion. If you look at both it becomes
clear:
hjp=> select conname,
╔════════════════╤═════════╤═══════════════╤════════════╗pg_encoding_to_char(conforencoding) as for_enc, pg_encoding_to_char(contoencoding) to_enc, condefault from pg_conversion where conname like 'big5%';
║ conname │ forenc │ toenc │ condefault ║
╟────────────────┼─────────┼───────────────┼────────────╢
║ big5toeuctw │ BIG5 │ EUCTW │ t ║
║ big5tomic │ BIG5 │ MULE_INTERNAL │ t ║
║ big5toutf8 │ BIG5 │ UTF8 │ t ║
╚════════════════╧═════════╧═══════════════╧════════════╝
(3 rows)
If you need to convert from BIG5 to UTF8, big5toutf8 is the default
(and indeed only) conversion. If you need to convert from BIG5 to
EUCTW, it's big5toeuctw, etc.
--hjp_ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
- Jump to comment-1Igor Korot<ikorot01@gmail.com>Apr 19, 2026, 10:09 PM UTCHi, ALL,
My question comes from the fact that "Character Set", LC_COLLATE and
LC_CTYPE can be
used here: https://www.postgresql.org/docs/18/sql-createdatabase.html
However its a little bit confusing.
The character set should define the collate and the CType things. But
according to the docs
it looks like its vice versa.
Also, there is no reference on where do I get the corresponding values
for LCCOLLATE and LCCTYPE.
Thank you,
On Sun, Apr 19, 2026 at 3:27 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi, David,
On Sat, Apr 18, 2026 at 2:19 AM David G. Johnston<david.g.johnston@gmail.com> wrote:
On Friday, April 17, 2026, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
Does the list shown in
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
This wouldn’t be under the purview of information schema. You can find pg-specific pieces though:
https://www.postgresql.org/docs/current/catalog-pg-conversion.html
Note the function used to convert ids to names.
Tried the following query:
SELECT conname AS name, pgencodingto_char( conforencoding ) AS
encoding, condefault AS default FROM pg_conversion ORDER BY encoding;
and got following results (for simplicity I will post only couple of rows):
big5toutf8 | BIG5 | t
big5toeuc_tw | BIG5 | t
big5tomic | BIG5 | t
euccntomic | EUCCN | t
euccntoutf8 | EUCCN | t
eucjis2004toshiftjis2004 | EUCJIS2004 | t
eucjis2004toutf8 | EUCJIS2004 | t
eucjptomic | EUCJP | t
eucjptosjis | EUCJP | t
eucjptoutf8 | EUCJP | t
euckrtoutf8 | EUCKR | t
euckrtomic | EUCKR | t
euctwtobig5 | EUCTW | t
euctwtoutf8 | EUCTW | t
euctwtomic | EUCTW | t
What I noticed is that all encodings are default, as they all have 't'
in the last column.
It's a little confusing...
Thx for the help.
Or is it hard coded inside the PostgreSQL codebase?
Yes. Doesn’t preclude exposing it via SQL but we don’t do so directly.
David J.
- Jump to comment-1Tom Lane<tgl@sss.pgh.pa.us>Apr 18, 2026, 3:08 PM UTCIgor Korot <ikorot01@gmail.com> writes:
Does the list shown in
No, the SQL standard doesn't specify any such view.
https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
stored somewhere in INFORMATION_SCHEMA?
You could try
# select n, pgencodingtochar(n) from generateseries(0,50) n;n pg_encoding_to_char 0 SQL_ASCII 1 EUC_JP 2 EUC_CN 3 EUC_KR 4 EUC_TW 5 EUC_JIS_2004 6 UTF8 ... regards, tom lane