Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbDoT-00029q-GS for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Nov 2020 02:18:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kbDoS-0003LT-G8 for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Nov 2020 02:18:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbDoS-0003LM-8r for pgsql-hackers@lists.postgresql.org; Sat, 07 Nov 2020 02:18:44 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbDoO-0002su-Et for pgsql-hackers@lists.postgresql.org; Sat, 07 Nov 2020 02:18:43 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id C5D54C85; Fri, 6 Nov 2020 21:18:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 06 Nov 2020 21:18:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=o6IOk7gfPgdKNfC4s alYFVn/t5Vxa5y0/DqPPVEFwjo=; b=bpiZmBGmgjRWD8LCSs4P1cdzhmC7MRcXX Wjn95PM2Qp/DAo6e9FzaKTD0nNv0jX1I4zX7WJ7a5L9yFVxSP05idJeuJ4gG2rYF tN7yjdvUCWh+TqxG6wqUfEJ30Hvpg0pl7fqQYl9oBistkH38N7NNu05yPDO0bFsF svggaFV+KGU83kol5FrHzWVkUnbCia9FBtKzjXA9tNnvPzsOgZQTuVOBkzBtainE 6SVuwBTBWieogTWfPwdc4BQlzynbpYRkpzrF8IlFDJ0vXjfWsYkNhMqMsC4Pwh+Y 0YIp34U571tqeqHLA5CPDloP6vZjgvDDbUsT1+qZmC3GplCswtzzg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddutddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujggfsehttdertddtredvnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeejgedtfeeuleeufeelkeefgeektdegteehfeevueehheeu gfetveeuuefhfeegveenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukf hppeduledtrdelhedrudelrddugeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.148]) by mail.messagingengine.com (Postfix) with ESMTPA id E0FFE32803D4; Fri, 6 Nov 2020 21:18:37 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8C23C2A0FDA; Fri, 6 Nov 2020 23:18:35 -0300 (-03) Date: Fri, 6 Nov 2020 23:18:35 -0300 From: Alvaro Herrera To: Justin Pryzby Cc: David Rowley , pgsql-hackers@lists.postgresql.org Subject: Re: pg_dump, ATTACH, and independently restorable child partitions Message-ID: <20201107021835.GA13348@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201024195949.GL9241@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Oct-24, Justin Pryzby wrote: > On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > > Now that I look, it seems like this is calling PQexec(), which sends a single, > > "simple" libpq message with: > > |CREATE TABLE ..; ALTER TABLE .. ATTACH PARTITION; > > ..which is transactional, so when the 2nd command fails, the CREATE is rolled back. > > https://www.postgresql.org/docs/9.5/libpq-exec.html#LIBPQ-EXEC-MAIN > > The easy fix is to add an explicit begin/commit. Hmm, I think this throws a warning when used with "pg_restore -1", right? I don't think that's sufficient reason to discard the idea, but it be better to find some other way. I have no ideas ATM :-(