public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andreas Karlsson <[email protected]>
To: Laurenz Albe <[email protected]>
To: Tom Lane <[email protected]>
To: [email protected]
Subject: Re: Mutable foreign key constraints
Date: Fri, 13 Sep 2024 15:05:49 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On 9/13/24 4:41 AM, Laurenz Albe wrote:
> That's very broken and should not be allowed.

+1

>> 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.
> 
> I hope that there are few cases of that in the field, and I think it
> is OK to break them.  After all, it can be fixed with a simple
> 
>    ALTER TABLE foo ALTER id TYPE timestamptz;
> 
> If the session time zone is UTC, that wouldn't even require a rewrite.
> 
> I agree that it cannot be backpatched.

I unfortunately suspect there might be more cases than we think in the 
field due to many people not understanding the difference between 
timestamp and timestamptz but the good thing is that 
timestamp/timestamptz are rare in foreign keys, even in composite ones.

Since this is quite broken and does not have any real world usefulness I 
think we should just go ahead and disallow it and have a few people 
complain.

Andreas







view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Mutable foreign key constraints
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox