Convert Existing Table to a Partition Table in PG10 - Mailing list pgsql-general

From Clifford Snow
Subject Convert Existing Table to a Partition Table in PG10
Date
Msg-id CADAoPLp9yGEF=o=E0DpTw2BKt=iT1ETwh-pcj2=2+gQsBPExsg@mail.gmail.com
Whole thread Raw
Responses Re: Convert Existing Table to a Partition Table in PG10  ("Ravi Krishna" <srkrishna@yahoo.com>)
List pgsql-general
I have a large table that needs converting to the native partitioning available in PG10. I'm looking for a strategy to safely move the data. I was considering a CREATE TABLE new LIKE old  PARTITION ON(my_timestamp). But I figured postgres would execute that before I could create the child tables. Does the new table and all of it;s child tables need to be created first and then move the data over? 

If I use the strategy of creating the new table and child tables, is it faster to directly populate the child tables with data or copy the data in to the new table and let the native partitioning move the data to the correct child partition? 

One other question. My table gets updated every minute. I use a trigger to add a subset of some of the data to another table. Will that still work?

Thanks in advance,
Clifford


--
@osm_seattle
OpenStreetMap: Maps with a human touch

pgsql-general by date:

Previous
From: Andres Freund
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Next
From: "Ravi Krishna"
Date:
Subject: Re: Convert Existing Table to a Partition Table in PG10