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 1h9tLJ-0001Tl-Lg for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 15:22:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9tLI-0006tc-Dn for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 15:22:52 +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 1h9tLI-0006tV-4o for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 15:22:52 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9tLB-00026t-7g for pgsql-hackers@postgresql.org; Fri, 29 Mar 2019 15:22:51 +0000 Received: by mail-qt1-x844.google.com with SMTP id h39so3019634qte.2 for ; Fri, 29 Mar 2019 08:22:44 -0700 (PDT) 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=iFrTn2CeTodV9OW/CTowqqv32qkUaIMFGjHcnB845rM=; b=WGuXkHCjkhNwsCkjabJJ1/1A6fhCr4dOiHnp0d1D6Do004WDdOJcA5Z027p/mW98er Bp6EKw1XsR59knn0kgdQW6vc/4QkMjqGhzf5l6rXb3qBdIPzw4K5b4p+rg7CHs82hSaa DP2svRuBl2If5vD0hh3L/yqF0U8x12JfVeC4Vq7P/bONYclbSFpn9bBZ0tIOxYTXVjiW +IKI8mxj8aYQyPKzfejxTTRElja/efpkuuEa+hRniOs5HzgYu6mINNO7T1/sWliN0HnE GkdwkgZyPgyOpa1e9WDv+Kr/7lagUhYd4Ml/Gak/U9OgV3PMVWt2hm+ZtdhTcRTVManC veTw== 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=iFrTn2CeTodV9OW/CTowqqv32qkUaIMFGjHcnB845rM=; b=M7xhMHi0967kiUOHPeeW2rDfhUvg0TLyH8eL+5ceWsJD/toEbJDTEzouv/BjVyGgtd V4DckMPVwH0FpfQ+sHj6xqPKhdbmVJhr1+/YPK6aeJroC+WssJEh4YzPmlAcyLMhWh90 KtvUD/U0W6pgvnntvNWuPNtuMCBrZwz9+7xh1Ovwa/dpQRAYc/0CdGLeyzOu+uoS7YbC cYCCyzyhyKR7g4M7wIq1pqFN0EqZvz+G6c3tTu5n9nHkKqmmY1Eq3BlbiNV+Tcs3Aoke ourBAOdZuZiEa4uo4zPZEw+b6Momo+wm6wPyYGBC2lWCItPg6eTrb2LfVOQqiB1ffDxm zM7A== X-Gm-Message-State: APjAAAXx3C41FC/IdhyaMGA1g8AqV2H8jJdpXAdP/O/4mLFZpSWpTREP cJBiry+LNZ8YZA0S1CU0VwCCUvhT1jB3Wg== X-Google-Smtp-Source: APXvYqybMou33C55xS7FXe9md8HuKCeu6KMLDQaexGL/1bfT5k9xTY0XNYEopqc11PzjtvhwkRDoGw== X-Received: by 2002:a0c:d04b:: with SMTP id d11mr40237587qvh.63.1553872963375; Fri, 29 Mar 2019 08:22:43 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id y18sm1361305qtc.52.2019.03.29.08.22.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 08:22:42 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 22873120A6D; Fri, 29 Mar 2019 12:22:39 -0300 (-03) Date: Fri, 29 Mar 2019 12:22:39 -0300 From: Alvaro Herrera To: Jesper Pedersen Cc: Amit Langote , Pg Hackers Subject: Re: partitioned tables referenced by FKs Message-ID: <20190329152239.GA29258@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Mar-29, Jesper Pedersen wrote: > Could expand a bit on the change to DEPENDENCY_INTERNAL instead of > DEPENDENCY_PARTITION_PRI / DEPENDENCY_PARTITION_SEC ? The PARTITION dependencies work in a way that doesn't do what we want. Admittedly, neither does INTERNAL, but at least it's less bad. > If you run "DROP TABLE t2_p32 CASCADE" the foreign key constraint is removed > from all of t1. Yes. CASCADE is always a dangerous tool; if you run the DROP partition without cascade, it explicitly lists that the constraint is going to be dropped. If you get in the habit of added CASCADE to all your drops, you're going to lose data pretty quickly. In this case, no data is lost, only a constraint. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services