Re: List of encodings

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: List of encodings
Date: 2026-04-21 02:55:07
Message-ID: CANzqJaBOXcTxEMUvohHMj+7FZgFnPt5Hw4TmJTccfzo1DQK2bg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)gmail(dot)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(at)gmail(dot)com> wrote:
> >
> > Hi, ALL,
> >
> >
> > On Sun, Apr 19, 2026 at 8:32 PM Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
> wrote:
> > >
> > >
> > >
> > > On Sun, Apr 19, 2026 at 9:13 PM Igor Korot <ikorot01(at)gmail(dot)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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2026-04-21 03:29:11 Re: List of encodings
Previous Message Igor Korot 2026-04-21 02:47:12 Re: List of encodings