Re: altering a column's collation leaves an invalid foreign key

Paul A Jungwirth <pj@illuminatedcomputing.com>

From: Paul Jungwirth <pj@illuminatedcomputing.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-25T06:47:26Z
Lists: pgsql-hackers

Attachments

On 3/23/24 10:04, Paul Jungwirth wrote:
> Perhaps if the previous collation was nondeterministic we should force a re-check.

Here is a patch implementing this. It was a bit more fuss than I expected, so maybe someone has a 
better way.

We have had nondeterministic collations since v12, so perhaps it is something to back-patch?

Yours,

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com

Commits

  1. Fix error code for referential action RESTRICT

  2. doc: Improve description of referential actions

  3. Add tests for foreign keys with case-insensitive collations

  4. Fix collation handling for foreign keys

  5. Clarify a foreign key error message