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 1gsuro-0003Sn-Tq for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Feb 2019 19:34:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsurn-0001fx-L3 for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Feb 2019 19:34:15 +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 1gsurn-0001fq-4e for pgsql-hackers@lists.postgresql.org; Sun, 10 Feb 2019 19:34:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsurk-00037I-Kz for pgsql-hackers@postgresql.org; Sun, 10 Feb 2019 19:34:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1AJY6bD007833; Sun, 10 Feb 2019 14:34:07 -0500 From: Tom Lane To: Peter Geoghegan cc: Alvaro Herrera , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) In-reply-to: References: <20190205212829.GA20127@alvherre.pgsql> <4572.1549404528@sss.pgh.pa.us> <20444.1549423295@sss.pgh.pa.us> <26049.1549516498@sss.pgh.pa.us> <18885.1549642539@sss.pgh.pa.us> <27642.1549815178@sss.pgh.pa.us> <24613.1549817419@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Sun, 10 Feb 2019 10:22:37 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7831.1549827246.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 10 Feb 2019 14:34:06 -0500 Message-ID: <7832.1549827246@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > I think that the wording for this example needs to be tweaked. > Other than that, looks good to me. After looking closer, I find that it's valid SGML to collapse the two items into one entry, so how about: DEPENDENCY_PARTITION_PRI (P= ) DEPENDENCY_PARTITION_SEC (S= ) The dependent object was created as part of creation of the referenced object, and is really just a part of its internal implementation; however, unlike INTERNAL, there is more than one such referenced object. The dependent objec= t must not be dropped unless at least one of these referenced objects is dropped; if any one is, the dependent object should be dropped whether or not CASCADE is specified. Also unlike INTERNAL, a drop of some other object that the dependent object depends on does not result in automatic deletion of any partition-referenced object. Hence, if the drop does not cascade to at least one of these objects via some other path, it will be refused. (In most cases, the dependent object shares all its non-partition dependencies with at least one partition-referenced object, so that this restriction does not result in blocking any cascaded delete.) Primary and secondary partition dependencies behave identically except that the primary dependency is preferred for use in error messages; hence, a partition-dependent object should have one primary partition dependency and one or more secondary partition dependencies. Note that partition dependencies are made in addition to, not instead of, any dependencies the object would normally have. This simplifies ATTACH/DETACH PARTITION operations: the partition dependencies need only be added or removed. Example: a child partitioned index is made partition-dependent on both the partition table it is on and the parent partitioned index, so that it goes away if either of those is dropped, but not otherwise. The dependency on the parent index is primary, so that if the user tries to drop the child partitioned index, the error message will suggest dropping the parent index instead (not the table). regards, tom lane