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 1gsdk5-0000PY-2R for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Feb 2019 01:17:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsdk2-00082l-FP for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Feb 2019 01:17:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsdk1-00082d-S1 for pgsql-hackers@lists.postgresql.org; Sun, 10 Feb 2019 01:17:06 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsdjt-0004xv-Tr for pgsql-hackers@postgresql.org; Sun, 10 Feb 2019 01:17:04 +0000 Received: by mail-qt1-x843.google.com with SMTP id e5so8325846qtr.12 for ; Sat, 09 Feb 2019 17:16:57 -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=TWiojAKopotDMyOEMithFD11NBGAXMH6NViEJ4uA2/Y=; b=XVi71gMksflhZg2xFmFK5yKtf2vxKbR871F3ZPfb226EkjDIeqyZtjGXyEV8HEWHbT eJCsHSZFmBGtcRbWfKHvwZSmdkjvo/zCgs63jMZCO4EM6iqFVRUhet+9FW47b0qTWGkU ADoMGT9DuXAIwhiwxEm3XTEZDMAC7V33KDDKE3Jt6bH67gAwnIPnyk9y6oR8wLzwVrDl WDuzfn2DeYRLPzF6C1/MGmDFn7615dcaz+UqTw4GEBp2eyqA5RBAk92KMCB+jB28zYvO 508BjcJ1EqPUG3W9r9xqq7yMUsxT/6mq/g6VV5Cue693Ka/5YzDwavm70BFKDKugic+Q pVXQ== 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=TWiojAKopotDMyOEMithFD11NBGAXMH6NViEJ4uA2/Y=; b=pyUybx8/yF9jgRnAoDD/GlpX0Bn2eOsSFwAaHgIe/aGUq+z7hBxtnp+cc7OtoZ9ZkC FG5lSyQi6sEzrvyJ9GJeE28kR4F6P1tP7t3A3cjCdIM1qnUmQdLo35loeX253lRiSXq3 OH64eQznGa19ZgkxwMB10Gcsc4CFYk0rs8QFZZkTzn5q2S7bZDQDgyuM0JHPDg0pPKtf u2UA+c9SEprumUbQ0xRXfqCPMAnjYrfmFHhFHai6Hj9pkIpHqaXmv/hXGBLkWrw/ihP6 K9cgvevv38GvwDLcRy4A4ZnXIc/9D+ZOBZqvXR7udLxI5cN9U+l8B/AP2flQ+mWeiles mTvw== X-Gm-Message-State: AHQUAuaJPIxNvXGA5mChJOA1ke8+cks7QP9dsY7P0kodriNJGw8TAciH uHEhwwuxb7AT6NZuMEXzYH6gkA== X-Google-Smtp-Source: AHgI3IZqgWszCFZwjsxDJGYDWhdopWPiEu5XKW+fKhoTqnWIPlo8raUDAyO2XY96aZYBALuJAsNlfA== X-Received: by 2002:a0c:99d9:: with SMTP id y25mr22011574qve.133.1549761416885; Sat, 09 Feb 2019 17:16:56 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([201.186.80.67]) by smtp.gmail.com with ESMTPSA id u19sm5605571qka.43.2019.02.09.17.16.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Feb 2019 17:16:56 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 67A5C120B55; Sat, 9 Feb 2019 22:16:54 -0300 (-03) Date: Sat, 9 Feb 2019 22:16:54 -0300 From: Alvaro Herrera To: Tom Lane Cc: Amit Langote , Peter Geoghegan , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) Message-ID: <20190210011654.GA30811@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <32757.1549744015@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Feb-09, Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Feb-09, Tom Lane wrote: > >> Well, the question that's begged here is exactly why it's okay to > >> remove the trigger and dependency link despite the fact that the > >> constraint needs it. I suppose the answer is that we'll > >> subsequently insert a new trigger implementing the same constraint > >> (and internally-linked to it)? That information is what I'd like > >> to have in the comment. > > > Well, the answer is that the trigger is no longer needed. This is > > an action trigger, i.e. it's attached to the referenced relation; > > and the action is making an independent table become a partition. > > Since the partition is reachable by the action trigger that goes > > through the parent table, we no longer need the action trigger that > > goes directly to the partition. > > Oh ... then why don't we go ahead and get rid of the constraint entry, > too? Because each partition has its own pg_constraint entry. (Otherwise there's no place to put the column numbers into -- they can differ from partition to partition, remember.) The only thing we do is mark it as child of the parent's one. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services