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 1t6UYN-00DLmC-Ar for pgsql-general@arkaria.postgresql.org; Thu, 31 Oct 2024 12:45:31 +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 1t6UYL-000yys-Ds for pgsql-general@arkaria.postgresql.org; Thu, 31 Oct 2024 12:45:29 +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 1t6UYL-000yyk-2A for pgsql-general@lists.postgresql.org; Thu, 31 Oct 2024 12:45:29 +0000 Received: from wolff.to ([98.103.208.27]) by magus.postgresql.org with smtp (Exim 4.94.2) (envelope-from ) id 1t6UYJ-004048-7U for pgsql-general@lists.postgresql.org; Thu, 31 Oct 2024 12:45:28 +0000 Received: (qmail 5568 invoked by uid 500); 31 Oct 2024 12:20:02 -0000 Date: Thu, 31 Oct 2024 07:20:02 -0500 From: Bruno Wolff III To: Dominique Devienne Cc: pgsql-general@lists.postgresql.org Subject: Re: COPY documentation with regard to references constraints Message-ID: <20241031122002.GA4435@wolff.to> Mail-Followup-To: Bruno Wolff III , Dominique Devienne , pgsql-general@lists.postgresql.org References: <20241031113832.GA3409@wolff.to> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 31, 2024 at 13:15:34 +0100, Dominique Devienne wrote: > >AFAIK, DEFERRABLE is for temporary violations crossing statement boundaries, >to postpone the enforcement of FKs at COMMIT time of the transaction. > >While a single COPY is just one statement, so whether a temporary violation >for self-referential FKs would occur would be implementation-dependent, >and thus "neither logical" nor predictable. > >Applies to other statement types too. Thanks. I needed to look more carefully under deferrable where it says the following: This controls whether the constraint can be deferred. A constraint that is not deferrable will be checked immediately after every command. That is pretty clear.