pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Simon Riggs <simon@2ndquadrant.com>
To: Ben Hood <ben@relops.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Detaching multiple partitions in 1 ALTER TABLE statement
Date: Thu, 20 Jun 2019 10:09:43 -0700
Message-ID: <769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com> (raw)
In-Reply-To: <CANP8+jK61qC3ouHceNME+po7_b5LXsaw7P9UYkwGuobQ=4S_aA@mail.gmail.com>
References: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com>
	<CANP8+jK61qC3ouHceNME+po7_b5LXsaw7P9UYkwGuobQ=4S_aA@mail.gmail.com>

On 6/20/19 9:00 AM, Simon Riggs wrote:
> On Thu, 20 Jun 2019 at 15:19, Ben Hood <ben@relops.com 
> <mailto:ben@relops.com>> 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/ <http://www.2ndquadrant.com/;
> PostgreSQL Solutions for the Enterprise


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (3+ messages)

Message-ID: <769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com>
Permalink:  ../769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com/
Also on:    postgresql.org/message-id/769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, simon@2ndquadrant.com, ben@relops.com
  Subject: Re: Detaching multiple partitions in 1 ALTER TABLE statement
  In-Reply-To: <769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com>
  References: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com> <CANP8+jK61qC3ouHceNME+po7_b5LXsaw7P9UYkwGuobQ=4S_aA@mail.gmail.com> <769fbf8e-e649-0b6f-ab33-d564d0028325@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox