Thread

  1. List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-18T06:46:16Z

    Hi, 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.
    
    
    
    
  2. Re: List of encodings

    David G. Johnston <david.g.johnston@gmail.com> — 2026-04-18T07:19:21Z

    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.
    
    
    >
    > 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.
    
  3. Re: List of encodings

    Tom Lane <tgl@sss.pgh.pa.us> — 2026-04-18T15:08:31Z

    Igor Korot <ikorot01@gmail.com> writes:
    > Does the list shown in
    > https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED
    > stored somewhere in INFORMATION_SCHEMA?
    
    No, the SQL standard doesn't specify any such view.
    
    You could try
    
    # select n, pg_encoding_to_char(n) from generate_series(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
    
    
    
    
  4. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-19T20:27:46Z

    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, pg_encoding_to_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):
    
     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
    
    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.
    
    
    
    
  5. Re: List of encodings

    Adrian Klaver <adrian.klaver@aklaver.com> — 2026-04-19T21:21:22Z

    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, pg_encoding_to_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):
    > 
    >   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
    > 
    > 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."
    
    
    > 
    > 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.
    > 
    > 
    
    
    -- 
    Adrian Klaver
    adrian.klaver@aklaver.com
    
    
    
    
  6. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-19T22:09:34Z

    Hi, 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 LC_COLLATE and LC_CTYPE.
    
    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, pg_encoding_to_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):
    >
    >  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
    >
    > 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.
    
    
    
    
  7. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-20T00:19:15Z

    Hi, 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, pg_encoding_to_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):
    > >
    > >   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
    > >
    > > 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?
    
    Thank you.
    
    >
    >
    > >
    > > 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.
    > >
    > >
    >
    >
    > --
    > Adrian Klaver
    > adrian.klaver@aklaver.com
    
    
    
    
  8. Re: List of encodings

    David G. Johnston <david.g.johnston@gmail.com> — 2026-04-20T00:41:22Z

    On Sun, Apr 19, 2026 at 5:19 PM Igor Korot <ikorot01@gmail.com> wrote:
    
    > condefault bool
    >
    > True if this is the default conversion
    >
    >
    In theory a given pair of encodings could have more than one converter
    installed.  Only one of those many could be marked default.
    
    David J.
    
  9. Re: List of encodings

    Adrian Klaver <adrian.klaver@aklaver.com> — 2026-04-20T00:53:21Z

    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?
    
    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
    
    
    
    
  10. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-20T00:55:37Z

    Hi, 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
    >>
    >
    > In theory a given pair of encodings could have more than one converter installed.  Only one of those many could be marked default.
    
    I think you meant to stay "should", right?
    
    "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.
    >
    
    
    
    
  11. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-20T01:13:29Z

    Adrian,
    
    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?
    >
    > 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.
    
    So, let's say I chose "BIG5"".
    
    As stated the table contains:
    
     big5_to_utf8                   | BIG5           | t
     big5_to_euc_tw                 | BIG5           | t
     big5_to_mic                    | BIG5           | t
    
    Since all 3 are default character sets, which one would be chosen?
    (in the context of CREATE DATABASE)
    
    Thank you.
    
    >
    > >
    > > Thank you.
    > >
    >
    >
    >
    > --
    > Adrian Klaver
    > adrian.klaver@aklaver.com
    
    
    
    
  12. Re: List of encodings

    Ron Johnson <ronljohnsonjr@gmail.com> — 2026-04-20T01:31:43Z

    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:
    >
    >  big5_to_utf8                   | BIG5           | t
    >  big5_to_euc_tw                 | BIG5           | t
    >  big5_to_mic                    | 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.)
    
    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!
    
  13. Re: List of encodings

    Tom Lane <tgl@sss.pgh.pa.us> — 2026-04-20T01:49:30Z

    Ron 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
    > misunderstanding the purpose of the pg_conversion table.)
    
    Indeed.  I doubt that CREATE DATABASE references this catalog at all.
    
    > Wouldn't it only *convert* text when a client is inserting text of encoding
    > X into a table with encoding Y?
    
    In the current system structure, where conversion actually happens
    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
    
    
    
    
  14. Re: List of encodings

    Peter J. Holzer <hjp-pgsql@hjp.at> — 2026-04-20T05:53:52Z

    On 2026-04-19 20:13:29 -0500, Igor Korot wrote:
    > So, let's say I chose "BIG5"".
    > 
    > As stated the table contains:
    > 
    >  big5_to_utf8                   | BIG5           | t
    >  big5_to_euc_tw                 | BIG5           | t
    >  big5_to_mic                    | BIG5           | t
    > 
    > Since all 3 are default character sets, which one would be chosen?
    > (in the context of CREATE DATABASE)
    
    Note that the table contains *two* encodings (conforencoding and
    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     │ for_enc │    to_enc     │ condefault ║
    ╟────────────────┼─────────┼───────────────┼────────────╢
    ║ big5_to_euc_tw │ BIG5    │ EUC_TW        │ t          ║
    ║ big5_to_mic    │ BIG5    │ MULE_INTERNAL │ t          ║
    ║ big5_to_utf8   │ BIG5    │ UTF8          │ t          ║
    ╚════════════════╧═════════╧═══════════════╧════════════╝
    (3 rows)
    
    If you need to convert from BIG5 to UTF8, big5_to_utf8 is the default
    (and indeed only) conversion. If you need to convert from BIG5 to
    EUC_TW, it's big5_to_euc_tw, etc.
    
            hjp
    
    
    -- 
       _  | Peter J. Holzer    | Story must make more sense than reality.
    |_|_) |                    |
    | |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
    __/   | http://www.hjp.at/ |       challenge!"
    
  15. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-21T02:42:18Z

    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:
    >>
    >>  big5_to_utf8                   | BIG5           | t
    >>  big5_to_euc_tw                 | BIG5           | t
    >>  big5_to_mic                    | 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!
    
    
    
    
  16. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-21T02:47:12Z

    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 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:
    > >>
    > >>  big5_to_utf8                   | BIG5           | t
    > >>  big5_to_euc_tw                 | BIG5           | t
    > >>  big5_to_mic                    | 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!
    
    
    
    
  17. Re: List of encodings

    Ron Johnson <ronljohnsonjr@gmail.com> — 2026-04-21T02:55:07Z

    Igor,
    
    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 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:
    > > >>
    > > >>  big5_to_utf8                   | BIG5           | t
    > > >>  big5_to_euc_tw                 | BIG5           | t
    > > >>  big5_to_mic                    | 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!
    >
    
    
    -- 
    Death to <Redacted>, and butter sauce.
    Don't boil me, I'm still alive.
    <Redacted> lobster!
    
  18. Re: List of encodings

    David G. Johnston <david.g.johnston@gmail.com> — 2026-04-21T03:29:11Z

    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.
    
    David J.
    
  19. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-21T04:22:00Z

    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?
    
    Thank you.
    
    >
    > David J.
    >
    
    
    
    
  20. Re: List of encodings

    David G. Johnston <david.g.johnston@gmail.com> — 2026-04-21T04:32:06Z

    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?
    >
    
    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.
    
    David J.
    
  21. Re: List of encodings

    Igor Korot <ikorot01@gmail.com> — 2026-04-21T04:58:24Z

    David,
    
    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?
    >
    >
    > 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.
    
    Understood, thx. This clears it up.
    
    Sorry for the confusion.
    
    And yes - I will query the pg_conversion table.
    
    Thx once again.
    
    >
    > David J.
    >