Re: [18] Policy on IMMUTABLE functions and Unicode updates

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: [18] Policy on IMMUTABLE functions and Unicode updates
Дата
Msg-id e7af415820ab4e559e6ddbd7de178475461f392a.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: [18] Policy on IMMUTABLE functions and Unicode updates  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [18] Policy on IMMUTABLE functions and Unicode updates
Список pgsql-hackers
On Wed, 2024-07-24 at 14:47 -0400, Robert Haas wrote:
> On Wed, Jul 24, 2024 at 1:45 PM Jeff Davis <pgsql@j-davis.com> wrote:
> > There's a qualitative difference between a collation update which
> > can
> > break your PKs and FKs, and a ctype update which definitely will
> > not.
>
> I don't think that's true. All you need is a unique index on
> UPPER(somecol).

Primary keys are on plain column references, not expressions; and don't
support WHERE clauses, so I don't see how a ctype update would affect a
PK.

In any case, you are correct that Unicode updates could put some
constraints at risk, including unique indexes, CHECK, and partition
constraints. But someone has to actually use one of the affected
functions somewhere, and that's the main distinction that I'm trying to
draw.

The reason why collation is qualitatively a much bigger problem is
because there's no obvious indication that you are doing anything
related to collation at all. A very plain "CREATE TABLE x(t text
PRIMARY KEY)" is at risk.

Regards,
    Jeff Davis




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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: schema variables
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [18] Policy on IMMUTABLE functions and Unicode updates