From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Dave Johansen <davejohansen@gmail.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Recommendations for partitioning?
Date: Fri, 20 Dec 2013 12:59:54 -0300
Message-ID: <20131220155954.GB22570@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <CAAcYxUc_aLKkcL5cjOF5m=E34HoE4og=nbtPjVX6qoLeC9cDvg@mail.gmail.com>
References: <CAAcYxUemBq7mqv_-1BVPe36udVEJjDoF2_-9G4Azv7nXZtmZ3A@mail.gmail.com>
<CAMkU=1wWcL9rzMzvsaV_OrqtexieVe16dEZvd2Q70hmB=JqLug@mail.gmail.com>
<CAAcYxUcb0NFfMDsMOCL5scNRrUL7=9hKxjz021JMQp0r7f5sCQ@mail.gmail.com>
<CAOR=d=3Et_2VBd9aVRtwDAiHzy+c0f0B3ur+-MfUAStMrpXsEg@mail.gmail.com>
<CAAcYxUc_aLKkcL5cjOF5m=E34HoE4og=nbtPjVX6qoLeC9cDvg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Dave Johansen escribió:
> On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe <scott.marlowe@gmail.com>wrote:
> > That's pretty much it. What I did was to create the new month table
> > and day tables, alter my triggers to reflect this, then move the data
> > with insert into / select from query for each old day partition. Then
> > once their data is moved you can just drop them. Since you changed the
> > triggers first those tables are no long taking input so it's usually
> > safe to drop them now.
>
> It would be nice if there was just a "move command", but that seems like
> the type of model that we want and we'll probably move to that.
Eh. Why can't you just do something like
WITH moved AS (
DELETE FROM src WHERE ..
RETURNING *
) INSERT INTO dst SELECT * FROM moved;
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: alvherre@2ndquadrant.com, davejohansen@gmail.com, scott.marlowe@gmail.com, jeff.janes@gmail.com
Subject: Re: Recommendations for partitioning?
In-Reply-To: <20131220155954.GB22570@eldon.alvh.no-ip.org>
* 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