Re: Move defaults toward ICU in 16?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Move defaults toward ICU in 16?
Дата
Msg-id 20230217205009.4sy4lmmqanbhjsgb@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: Move defaults toward ICU in 16?  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Move defaults toward ICU in 16?  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Hi,

On 2023-02-17 12:36:05 -0800, Jeff Davis wrote:
> > > There's already a check that the new cluster is empty, so I think
> > > it's
> > > safe to hack the pg_database locale fields.
> > 
> > I don't think we need to, we do issue the CREATE DATABASEs. So we
> > just need to
> > make sure that includes the collation provider info, and the proper
> > template
> > database, in pg_upgrade mode.
> 
> We must fixup template1/postgres in the new cluster (change it to libc
> to match the old cluster), because any objects existing in those
> databases in the old cluster may depend on the default collation. I
> don't see how we can do that without updating pg_database, so I'm not
> following your point.

I think we just drop/recreate template1 and postgres during pg_upgrade.  Yep,
looks like it. See create_new_objects():

        /*
         * template1 database will already exist in the target installation,
         * so tell pg_restore to drop and recreate it; otherwise we would fail
         * to propagate its database-level properties.
         */
        create_opts = "--clean --create";

and then:

        /*
         * postgres database will already exist in the target installation, so
         * tell pg_restore to drop and recreate it; otherwise we would fail to
         * propagate its database-level properties.
         */
        if (strcmp(old_db->db_name, "postgres") == 0)
            create_opts = "--clean --create";
        else
            create_opts = "--create";

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: The output sql generated by pg_dump for a create function refers to a modified table name
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Reducing connection overhead in pg_upgrade compat check phase