Re: Recommendations for partitioning?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Johansen escribió:
> On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe <scott.marlowe@xxxxxxxxx>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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux