pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ben Hood <ben@relops.com>
To: pgsql-general@lists.postgresql.org
Subject: Detaching multiple partitions in 1 ALTER TABLE statement
Date: Thu, 20 Jun 2019 15:19:48 +0100
Message-ID: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com> (raw)

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”:

https://www.postgresql.org/docs/12/sql-altertable.html

But I haven’t found an example of where multiple partitions are detached in 1 statement.

This is using version 12 beta 1.

Many thanks,

Ben






view thread (3+ messages)  latest in thread

Message-ID: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com>
Permalink:  ../F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com/
Also on:    postgresql.org/message-id/F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.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: ben@relops.com
  Subject: Re: Detaching multiple partitions in 1 ALTER TABLE statement
  In-Reply-To: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.com>
  References: <F0E75DFF-D633-447A-B4BA-84253B1D4AB0@relops.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