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 1hIhml-0000xI-SL for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 22:51:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIhmj-0005GB-Pi for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 22:51:37 +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 1hIhmj-0005G4-Dp for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 22:51:37 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIhmg-0000vP-91 for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 22:51:36 +0000 Received: by mail-qt1-x842.google.com with SMTP id d13so14003877qth.5 for ; Mon, 22 Apr 2019 15:51:33 -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=PtB1EtSmI0xCuVi7ojxpr0snDxZQWPfgwdPtZFMTXlo=; b=PZtBnJm4qf3KjqUvsEEhzHnoq5q7eYfGITJnOWHiqnXxtcPUxEYqvScxygeZx1qVwi N42XPMvH0FV5tcBKzaVQX/1AAnTp1REFP7zw546+nMVl7QnvUJNGQd5a4GNFmpp9TyGL U6RRYn+7ZdWXv0j8IKfGjr8Vun8LcaJwiY2WwgHVO64/rFqnlLdSb0zfaDTat8ACzgsB K6fGxHroj46Znm94kjTEdnzgAXGghFhigocuUVX17FOargJWiF880xIhgus0zvKIo82S Zjs5OTVE6YSgXMYuC/CckDECTVl2FZ/iFEyhKh01WR4Qyv3t4mA02R6G2KX1kgVvqbe3 mHuw== 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=PtB1EtSmI0xCuVi7ojxpr0snDxZQWPfgwdPtZFMTXlo=; b=R8heBrbu2G1q+nVxUIuFRwcuXyjLDsIB95xXIl8mULwkRv25HeruSe1C/P/Lfy9ou3 kzxX3+B9tyep+vKVW/LqMuOHYVFKFoyl466b64LO5J+PndOzKIokuEjsL/4lcCPWE9Af 30JvZk6unrtcyLuycBvOjJGLLtpQt9AQqgLsiGZ5udTpGSY+rdsCR1bXV32M9L0/K3Dx 9mdoMoyA33WKjLbXfOFpIkh2UH48nbIjV+v3FKliSOw7/GIuBEX63QowCCn1HTFbtM+H TccD8me+4KCv9fy0AQrMyq+NutM8U1s3hHrdOkNf0W9kjUfV2NtuJmnl4219tVtv3h+O TRPA== X-Gm-Message-State: APjAAAWrI4jNy1qMtJNX6EmEdfe7cF72oQ9w5zegG/mvVd4hVStTDxun Cgw6pWvXqhjMMA2OYt+/lejexQ== X-Google-Smtp-Source: APXvYqwrGpVLnTjrWs2mZ8arURDfzS6Cd4YKx+9gp8dRMHBH9PON+dTwH4UNQx4Qxvki5cu2DpghTg== X-Received: by 2002:aed:3fa9:: with SMTP id s38mr17738137qth.207.1555973492463; Mon, 22 Apr 2019 15:51:32 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id o50sm9094412qtc.23.2019.04.22.15.51.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 15:51:31 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id CD80A12075D; Mon, 22 Apr 2019 18:51:29 -0400 (-04) Date: Mon, 22 Apr 2019 18:51:29 -0400 From: Alvaro Herrera To: Robert Haas , Amit Langote , Tom Lane Cc: PostgreSQL Hackers Subject: Re: pg_dump is broken for partition tablespaces Message-ID: <20190422225129.GA6126@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16497.1551882967@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-Mar-06, Tom Lane wrote: > David Rowley writes: > > As far as I can see, the biggest fundamental difference with doing > > things this way will be that the column order of partitions will be > > preserved, where before it would inherit the order of the partitioned > > table. I'm a little unsure if doing this column reordering was an > > intended side-effect or not. > > Well, if the normal behavior results in changing the column order, > it'd be necessary to do things differently in --binary-upgrade mode > anyway, because there we *must* preserve column order. I don't know > if what you're describing represents a separate bug for pg_upgrade runs, > but it might. Is there any test case for the situation left behind by > the core regression tests? Now that I re-read this complaint once again, I wonder if a mismatching column order in partitions isn't a thing we ought to preserve anyhow. Robert, Amit -- is it by design that pg_dump loses the original column order for partitions, when not in binary-upgrade mode? To me, it sounds unintuitive to accept partitions that don't exactly match the order of the parent table; but it's been supported all along. In the statu quo, if users dump and restore such a database, the restored partition ends up with the column order of the parent instead of its own column order (by virtue of being created as CREATE TABLE PARTITION OF). Isn't that wrong? It'll cause an INSERT/COPY direct to the partition that worked prior to the restore to fail after the restore, if the column list isn't specified. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services