Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1imNV0-0007lF-Pf for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Dec 2019 19:48:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1imNUx-0000xC-Hk for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Dec 2019 19:48:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1imNUx-0000x5-4z for pgsql-bugs@lists.postgresql.org; Tue, 31 Dec 2019 19:48:11 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1imNUs-0005qv-JQ for pgsql-bugs@postgresql.org; Tue, 31 Dec 2019 19:48:10 +0000 Received: by mail-pf1-x441.google.com with SMTP id q8so20076999pfh.7 for ; Tue, 31 Dec 2019 11:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=1m5ene2w6yb8/J+62Z+F9oDEVvF2dsHBJDXN/J1bYpk=; b=wRCYi3R/5iXJ+M9dLZuXTdrwTOVMfOze/eGGnlQmLoNuM3t7pjC8dx2t+7QTi6Yql+ +F1gRKMJPwJt6zZMF62PESPdqC7ftBaXHO71neQqhvGqXzS3EzwNOPFTX5hHZKd0u7TQ x6DbB/Xh5KWpvhyOZO1e/XP3l6fy7zCRLA42GdnAuINPgK8y+sOg2k4DFf7yWoCqOISn ScKyua67Z/PT0YyymRjEmf0Y4qTMAfjL3cJL1lwZLSPYvW33nM8HkVXArUHJoKHLUlAT VnoBP8ICwCFeRnQlWvhf9sJE9539pBPRHv9V67OcgB+kJTgp4phcZTnYwTRWZvSjL6mh VQwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1m5ene2w6yb8/J+62Z+F9oDEVvF2dsHBJDXN/J1bYpk=; b=MdnV0nmBEGqmS18mr/tppWMFfl+ok8ARIWtHOkzt/di5VINwU2yVJHVyFmUJWxGkcl ak2HisX/LXeQCELKN5vp6L0QeM5x9fXvW8S/GJUe+GBWrhtVB34pLifMv3EIyIQZuxzJ MY8G9uZu6V1Aa1W9gSCVO5WZCDNu6q5z2JiR+rbABd/2jGnalGIBNIdJHlgUeyYqSzak qGLw0WjROZ+sSJzuupR8IkhyLbstMilZ33vZ+pEGHYsAyjOi/70WzHr1uhOphAMBhvqF j5egSkEAJ7gyOIGhgZL8qTcgyZJc47EIFx6ubKO+U4TxPhEhXKSamW/3xQZA33kV3qkJ OP3g== X-Gm-Message-State: APjAAAVh6OAtZ07JWjpbMSTclnCX0bzGfvPMvzawRK4R2ET2fhfdvD3h 2AQBeMJVF8pdvPxtp7YSO4tldg== X-Google-Smtp-Source: APXvYqxPR1wOwLkym+3BkLdeNSgkFdnL3Dwqv+RsERrXUc0rkQCeAwwt4tcWvo3/JsSw9HuRwCLGcw== X-Received: by 2002:aa7:96b0:: with SMTP id g16mr75763040pfk.99.1577821683708; Tue, 31 Dec 2019 11:48:03 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id z16sm57402959pff.125.2019.12.31.11.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Dec 2019 11:48:02 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 9202E300A93; Tue, 31 Dec 2019 16:47:59 -0300 (-03) Date: Tue, 31 Dec 2019 16:47:59 -0300 From: Alvaro Herrera To: Amit Langote Cc: Petr Fedorov , PostgreSQL mailing lists Subject: Re: A row-level trigger on a partitioned table is not created on a sub-partition created later Message-ID: <20191231194759.GA24692@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191227221826.GA2547@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2019-Dec-27, Alvaro Herrera wrote: > One thing I just realized is that in next minors' release notes we > should publish a recipe to fix catalogs for existing databases, unless > we go for a fix that doesn't require changing the catalogs -- I don't > know what that would be, though, but maybe it would not be totally > insane to clone even internal triggers in the cases that matter. So, the more I thought about this, the more it seemed that marking those triggers as not internal was the wrong thing to do. So I instead made it clone the internal triggers that seem to matter. This fixes the originally reported problem, and passes the test case I propose. Also, pg_dump continues to work unchanged, and existing database don't need tweaking (excepting those that might already be missing triggers). It would be better to fix master afterwards, by adding a pg_trigger.trgparentid column, which seems like it would be a better answer going forward. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --cNdxnHkX5QqsyA0e Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-failed-test-that-shows-the-issue.patch"