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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian he <jian.universality@gmail.com>
Cc: Paul Jungwirth <pj@illuminatedcomputing.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-07T20:12:08Z
Lists: pgsql-hackers
jian he <jian.universality@gmail.com> writes:
>> * in TryReuseForeignKey, we can pass the information that our primary
>> key old collation is nondeterministic
>> and old collation != new collation to the foreign key constraint.

I have a basic question about this: why are we allowing FKs to be
based on nondeterministic collations at all?  ISTM that that breaks
the assumption that there is exactly one referenced row for any
referencing row.

			regards, tom lane



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