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 1hIeNh-0007Ta-4L for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 19:13:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIeNf-0000R6-1m for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 19:13:31 +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 1hIeNe-0000Qz-Lp for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 19:13:30 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIeNb-0006mm-10 for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 19:13:29 +0000 Received: by mail-qt1-x841.google.com with SMTP id i14so13306131qtr.10 for ; Mon, 22 Apr 2019 12:13:26 -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=jNShTaIyeSeL86pCAB8OvNYqAxOFFEpLJQUr7YsgMhg=; b=T7FTOoR1nDiWtAn75BqFysNWt6OrREXXYZsvURTuEuLtc9SEYNPm6coMzJYrExa1Sa 65mVKK7Uu9pTPF+YZvzb5JtWLDR0Fxn1j6IwwwnHimar0s5+cz7enIkbZD5RMzc3tBDC ct/jyvCfATe4jI7JfTRnEUhWs8MjMYKP2zN5MdbXbGzmM4mkWwf/qLTxE7uGgkMJ+IC+ OzCiKbCrpBNGkHBnNighBP9Wgv5bMrNQk77qKWgBw8xMqGdaPRKkC+546m+1CCRLszc2 HImP/BK+W2rwDBYn6svR3lJDghw+FbRYEr/YF5+CKWGFJwDBDHtKzXgee5aKxeomHn7E YA8g== 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=jNShTaIyeSeL86pCAB8OvNYqAxOFFEpLJQUr7YsgMhg=; b=jKdcVASNICMkrBKZHXCUVnXfZqxmxi5ni73r+KrluJEN5d7N3jdHB3Lbtel3ashA/J Xjj4E9NLUmLC5oX93+pXciTeQiJjzB0tSZFbd9W8Atx2ZyZOFyqwQnPcWSSsn5/o835v kNKu4bP7/N/pEiZwmoV75ezAyZHqY9YG0nPWoWhS+KtUMzka7lUyn59Z4+haMUlogJjC sC8EL5RDdydwjQ2rdBTQ9o2S04YqLwr29erXdnoGDPKKeH/Dy5SnI1sxJHvHamviWMQs /moIgmCffjWDoSKubNVH7AUc3nYCnC0rS0eofLXyG7jdb96VSgavGXZIV2b5E5wZW5Eg 7GoA== X-Gm-Message-State: APjAAAUFhwWAwvhU2kxa85ZT937YeQoDoOIeT5458BHmS9rMEdaojI27 kO7QBRhUuqnLJFfvdhgumWNF6A== X-Google-Smtp-Source: APXvYqxOo5sOB2rhjhlIbUkGfDNYNEUWGs1ClVTTBsnYXKQtdFyBb+8EDSpOR2/KNNsXevyxzeJt3Q== X-Received: by 2002:ac8:1621:: with SMTP id p30mr6897811qtj.23.1555960406091; Mon, 22 Apr 2019 12:13:26 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([179.56.48.227]) by smtp.gmail.com with ESMTPSA id f123sm7164195qkd.63.2019.04.22.12.13.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 12:13:25 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id C336312069F; Mon, 22 Apr 2019 15:13:22 -0400 (-04) Date: Mon, 22 Apr 2019 15:13:22 -0400 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , Robert Haas , David Rowley , PostgreSQL Hackers Subject: Re: pg_dump is broken for partition tablespaces Message-ID: <20190422191322.GA30452@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <21097.1555957836@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-Apr-22, Tom Lane wrote: > Yeah, that's where I'm at as well. Alvaro's proposal could be made > to work perhaps, but I think it would still end up with some odd > corner-case behaviors. One example is that "TABLESPACE X" would > be allowed if the database's default tablespace is Y, but if you > try to dump and restore into a database whose default is X, it'd be > rejected (?). Hmm, I don't think so, because dump uses default_tablespace on a plain table instead of TABLESPACE clauses, and the table is attached afterwards. > The results after ALTER DATABASE ... SET TABLESPACE X > are unclear too. Currently we disallow SET TABLESPACE X if you have any table in that tablespace, and we do that by searching for files. A partitioned table would not have a file that would cause it to fail, so this is something to study. (BTW I think these tablespace behaviors are not tested very much. The tests we have are intra-database operations only, and there's only a single non-default tablespace.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services