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 1h9YS0-0001PC-01 for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Mar 2019 17:04:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9YRy-0004l8-Pe for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Mar 2019 17:04:22 +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 1h9YRy-0004l1-Ek for pgsql-bugs@lists.postgresql.org; Thu, 28 Mar 2019 17:04:22 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9YRt-0005kB-G7 for pgsql-bugs@lists.postgresql.org; Thu, 28 Mar 2019 17:04:21 +0000 Received: by mail-qt1-x844.google.com with SMTP id w30so23936644qta.8 for ; Thu, 28 Mar 2019 10:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=97EMTQdyEav7i5o9vcKge68ViE+aLDt0tj496+bT5Mw=; b=RtfAaLQDyh2fIxtNO9otfzT32PJ8ps7TKkIxIHhzgixCft3xXa0V6u6S8rIGEbSduE AfT9o0Cjk+A1nshBCH/LS1YuGKXZTHy2YuWpzH6zFLoft3xIlxR4UiXT8mjS8tggvZRP o7ZeoUSAa+ggRFquNS0GvNyKUC6ri6Fw4cMgRKTRmbkQ4oppHBrGVT0R316igxFX1s02 lrESifeM8QiHtS6vSTS2u09CMRTOAwvYtKOLBRuT+KmLpcQMbZqYDiUYoDYUQRJPR4yv qx7XX16GdQ8B/3HQC/c8QmytGjRXdt2FR9VyzKLJyxwBaznaItWYXihgJ9lQcXLAXB4/ QunQ== 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:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=97EMTQdyEav7i5o9vcKge68ViE+aLDt0tj496+bT5Mw=; b=FMZIiCZb5g1kvukE6nzUYtly4kj0wEQsbjHiGEUHHaYU2vNwvqhi3S3n3020nYshkH J81fVQNHvfm56I9HN2SuC1vNy4c5EynR+aSeXaS4ppJoo7as/Ev91j0zfcjO2Gtx7Ysu HX1kpEO3n+ZhTROye3+njw8dWLPnSofeHf6b6CoC7/T8L6cgSpy5CwhkeHjqEuuAdnK0 gBoPAkyztHov71faX1cL6+KuJtUp7H7cts1IT7uxbUG3DcDhNPnL+UTBaa5DWo+lJtPu lrmIQnGRktWuFLgMV8atCIU0sefmNFbRIFaxjcsZvPOwI6zw1zmlpsy5Y4LAREv2ONzS AubQ== X-Gm-Message-State: APjAAAU47Om9Hg7XNivJHXeTwEsN1+NJOacNmNVsH0lGbOO5DvEruxFv OGXUww0968kLl6Kct1ZU1Xncpw== X-Google-Smtp-Source: APXvYqyRekJaxHFIH9mqPrR/T1xvveA3lWhPYa3iiy2yCOrzwV9Hce/U77itPjx1UfVPTvSCx2+PLA== X-Received: by 2002:ac8:371d:: with SMTP id o29mr36405145qtb.389.1553792656832; Thu, 28 Mar 2019 10:04:16 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id w8sm11941847qki.54.2019.03.28.10.04.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 10:04:16 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 9E27E120C4B; Thu, 28 Mar 2019 14:04:13 -0300 (-03) Date: Thu, 28 Mar 2019 14:04:13 -0300 From: Alvaro Herrera To: pisarenco.a@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15718: DROP TABLE fails if it's partitioned by a key of a deleted enum Message-ID: <20190328170413.GA23764@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <15718-4484a0cd9cfb2b80@postgresql.org> 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-28, PG Bug reporting form wrote: > Code to replicate the issue: > https://pastebin.com/rc8q35Qj Please paste the code in the email. We don't like external references. > This happened to our ETL processes that re-create the staging data on each > run. Enums are defining partition keys for some tables, that then flow into > tables in another schema. When the schema containing that enum gets dropped, > the columns that use it are also dropped. Sounds like we're forgetting to add a dependency on the datatype of the partition key. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services