Re: Mutable foreign key constraints - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Mutable foreign key constraints
Date
Msg-id 4168208.1726179825@sss.pgh.pa.us
Whole thread Raw
In response to Re: Mutable foreign key constraints  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thursday, September 12, 2024, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> A possible objection is that if anybody has such a setup and
>> hasn't noticed a problem because they never change their
>> timezone setting, they might not appreciate us breaking it.
>> So I certainly wouldn't propose back-patching this.  But
>> maybe we should add it as a foot-gun defense going forward.

> I’m disinclined to begin enforcing this.  If they got a volatile data type
> in a key column and don’t attempt to index the key, which would fail on the
> volatile side, I’d be mighty surprised.

Um, neither type is "volatile" and each can be indexed just fine.
It's the cross-type comparison required by the FK that brings the
hazard.

> I suggest adding the commentary and queries used to check for just such a
> situation to the “don’t do this page” of the wiki and there just explain
> while allowed for backward compatibility it is definitely not a recommended
> setup.

Yeah, that's a possible approach.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Mutable foreign key constraints
Next
From: Thomas Munro
Date:
Subject: Re: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64