Re: best practice for moving millions of rows to child table when setting up partitioning? - Mailing list pgsql-admin

From Mark Stosberg
Subject Re: best practice for moving millions of rows to child table when setting up partitioning?
Date
Msg-id ips01d$351$1@dough.gmane.org
Whole thread Raw
In response to Re: best practice for moving millions of rows to child table when setting up partitioning?  (Bob Lunney <bob_lunney@yahoo.com>)
Responses Re: Re: best practice for moving millions of rows to child table when setting up partitioning?
Re: Re: best practice for moving millions of rows to child table when setting up partitioning?
List pgsql-admin
>> 5. Finally, I'll drop the indexes on the parent table and
>> truncate it.

Luckily I noticed the problem with TRUNCATE and partitioning before my
work got to production.

TRUNCATE cascades automatically and silently to child tables, which was
not my intent.

This is mentioned here:
http://wiki.postgresql.org/wiki/Table_partitioning

But is not mentioned in the official documentation for TRUNCATE:

http://www.postgresql.org/docs/9.0/static/sql-truncate.html

The work-around we used was to put the TRUNCATE statement ahead of the
ALTER TABLE .. INHERIT statements in our final transaction.

   Mark


pgsql-admin by date:

Previous
From: adrien ducos
Date:
Subject: My server is oddly very slow
Next
From: Scott Marlowe
Date:
Subject: Re: Re: best practice for moving millions of rows to child table when setting up partitioning?