Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFfwc-004kpZ-Si for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Jun 2024 20:12:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sFfwa-00E58N-Pl for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Jun 2024 20:12:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFfwa-00E58E-Fv for pgsql-hackers@lists.postgresql.org; Fri, 07 Jun 2024 20:12:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFfwY-000Vg9-Tq for pgsql-hackers@lists.postgresql.org; Fri, 07 Jun 2024 20:12:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 457KC8jo216628; Fri, 7 Jun 2024 16:12:08 -0400 From: Tom Lane To: jian he cc: Paul Jungwirth , PostgreSQL Hackers Subject: Re: altering a column's collation leaves an invalid foreign key In-reply-to: References: <78d824e0-b21e-480d-a252-e4b84bc2c24b@illuminatedcomputing.com> <69f0a887-a4ed-49cf-9d63-923891006658@illuminatedcomputing.com> Comments: In-reply-to jian he message dated "Fri, 07 Jun 2024 14:39:15 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <216626.1717791128.1@sss.pgh.pa.us> Date: Fri, 07 Jun 2024 16:12:08 -0400 Message-ID: <216627.1717791128@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk jian he 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