Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmQ1e-0002Du-Cu for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Dec 2020 23:34:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kmQ1d-0004cv-4C for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Dec 2020 23:34:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmQ1c-0004co-AW for pgsql-bugs@lists.postgresql.org; Mon, 07 Dec 2020 23:34:36 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmQ1V-0002kr-39 for pgsql-bugs@lists.postgresql.org; Mon, 07 Dec 2020 23:34:35 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 70B2F5C023E; Mon, 7 Dec 2020 18:34:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 07 Dec 2020 18:34:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=QQ3VYBHagfN9rAaBj hKHhSA+wTYLeVzj8Wwf94/4sOY=; b=bKngDpiYYtzVxtMHAx6bh0sNCTKaq/dQf 40ZP7aBgUhhF3ikCc0qfg6x35gbMriQetFkpy4bky7WlMGHbxE/9v1fGkXKq+n42 mh/S8E6cb1Q8hu5Zspg0x23NInHdNVZuXoZK/gWxwHoqVpf/X8rOl9hW8CZJ0Koh ZOxJSKOLtWVAQVNAZkVZhNzgVsalflWoJxIUCuWinNb5rWq8ga5Sve7l3ifENyvA zCD/TH8xuentZUdt8yrBJ5txtFDTfbWIIqoHip7oAN+4eWqxXmyC55qPtmzGg4O8 TrrXpEsY6+pHsyUfIJTfp6GRFm00wSHUB92mSEjvWnlz2J1a0pQGQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejhedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtuggjfgesthdtre dttdervdenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvefgleevgeeuje eghfegteeghfegheeifeehheelteetieduieeihffggfehffetnecukfhppeduledtrdel hedrudekrdejleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.18.79]) by mail.messagingengine.com (Postfix) with ESMTPA id C7F5D1080059; Mon, 7 Dec 2020 18:34:16 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id B15902A154D; Mon, 7 Dec 2020 20:34:14 -0300 (-03) Date: Mon, 7 Dec 2020 20:34:14 -0300 From: Alvaro Herrera To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org Subject: Re: ALTER CONSTRAINT on a partitioned FK isn't working Message-ID: <20201207233414.GA24167@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3144850.1607369633@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Dec-07, Tom Lane wrote: > then everything behaves as expected. So something is broken > about propagating deferred-ness to partition triggers in an > ALTER CONSTRAINT. Oddly, it *looks* like it worked if you > examine the child tables with "\d+". I surmise that ALTER CONSTRAINT > fixes whatever catalog fields psql looks at, but there's some other > fields that also need to be updated and aren't being. Yeah, this query shows that the tgdeferrable and tginitdeferred columns ought to be dropped: select tgname, tgdeferrable, tginitdeferred from pg_trigger; These are all 'true' when the constraint is created correctly, and false when changed by ALTER CONSTRAINT. Let me see about fixing that ...