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 1he0ZR-0003GX-EG for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 17:09:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1he0ZP-0001I6-GF for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 17:09:55 +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 1he0ZN-0001Hw-Oa for pgsql-general@lists.postgresql.org; Thu, 20 Jun 2019 17:09:55 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1he0ZG-000767-Hs for pgsql-general@lists.postgresql.org; Thu, 20 Jun 2019 17:09:52 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7967821E97; Thu, 20 Jun 2019 13:09:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 20 Jun 2019 13:09:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=p w+mCSvCfeHPP4sYEKhsZaayBiCVTAX1AbS4V4l/aTk=; b=XLS5BHkfm2CK+SuoF 2m3robpge65sVzA5B1/vJo/kmyutmQx5UaHNpXXKeF4QSAillSlR7JxqiAFKORye 0qNq6oEhxY3yKrUsT8W/2rbMPBezxmj6jo/Yc3sjG/SNvOKwjOyukbl0CX5fSDnv WVYTStKv9T7ekpK70bSmAcQ+ERSfnlPf3p0NJky8IvXu5IdzX37+DS97I/1dXECB Mvvgtx3GQdRU9RIO7EX8ZhSkmGWt/fG47i17yQkWu0EFdP7iEC9HxZ6VRIqdBiBf mtJ6Q3/SHrEsBQWHL36rwwmoImPS517bXQwJJbVSWg9Au151Q/Kz62WohICTGAqD HL8cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=pw+mCSvCfeHPP4sYEKhsZaayBiCVTAX1AbS4V4l/a Tk=; b=Rqe3X5YzvxXgXKLjpQ1AMVvL1xCGJTIsqY4D8juWckr3UbTFpGcCJXnFH x9ex/SzQQ6R3cvIhHOgV2n1/fIrmAoBLJyxZnW08cgi9ynIdRl2Dq9AM1co/ZKqO O3WP8WnxRQTieTuPr+F84l2Ie2KolApCrCq82k8dFCeBaJFBu19iNl7aoIxrR2Cv aK+Ua9DVFuwrDKbasvvVUyUXw2pb/bfUVFiKa6JDOxbCtJF7Yrl1Ry2qF7K1QJ6B TkFXUdvicNy32PhvULaguiSLrYoe88PohkLmc6XbErVcxHGOCiZBba5E7nMceK3X 9djzRGWFDql/ADvCbn9B2l2MROjpg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeggdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepjeegrdel fedruddthedrudekieenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (74-93-105-186-washington.hfc.comcastbusiness.net [74.93.105.186]) by mail.messagingengine.com (Postfix) with ESMTPA id A2E1780060; Thu, 20 Jun 2019 13:09:44 -0400 (EDT) Subject: Re: Detaching multiple partitions in 1 ALTER TABLE statement To: Simon Riggs , Ben Hood Cc: pgsql-general References: From: Adrian Klaver Message-ID: <769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com> Date: Thu, 20 Jun 2019 10:09:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/20/19 9:00 AM, Simon Riggs wrote: > On Thu, 20 Jun 2019 at 15:19, Ben Hood > wrote: > > Hi, > > I’m wondering what is the syntax for detaching multiple partitions > in 1 ALTER TABLE statement. > > I’ve tried this: > > > # ALTER TABLE movement_legs DETACH PARTITION > movement_legs_2019_06_20_11_15, DETACH PARTITION > movement_legs_2019_06_20_11_20; > psql: ERROR:  syntax error at or near "," > LINE 1: ...gs DETACH PARTITION movement_legs_2019_06_20_11_15, DETACH P… > > > The documentation suggests "DETACH PARTITION can be combined into a > list of multiple alterations to be applied together”: > > > Docs say this" All the forms of ALTER TABLE that act on a single table, > except RENAME , SET SCHEMA , ATTACH > PARTITION , and DETACH PARTITION  can be combined into a list of > multiple alterations to be > applied together." > > Perhaps a comma would be helpful, but its clear that you can do multiple ^not Or I am thoroughly confused:) > detaches in one command at present. > > But it sounds like a great feature. > > -- > Simon Riggshttp://www.2ndQuadrant.com/ > PostgreSQL Solutions for the Enterprise -- Adrian Klaver adrian.klaver@aklaver.com