Thread: Bulk load straight into partitioned table?

Bulk load straight into partitioned table?

From
Danny Lo
Date:
Hi,

I have about 150gb data that I'd like to bulk load into a table partitioned by month. I'm wondering if I could use the COPY command with a trigger on table to copy this in directly?
At the moment, I'm doing:

copy command into table_x

then sql command:

insert into master_table_a
select * from table_x

thanks,
Danny

Re: Bulk load straight into partitioned table?

From
Joshua Tolley
Date:
On Wed, May 19, 2010 at 4:13 PM, Danny Lo <lo.dannyk@gmail.com> wrote:
> Hi,
>
> I have about 150gb data that I'd like to bulk load into a table partitioned
> by month. I'm wondering if I could use the COPY command with a trigger on
> table to copy this in directly?
> At the moment, I'm doing:
>
> copy command into table_x
>
> then sql command:
>
> insert into master_table_a
> select * from table_x
>
> thanks,
> Danny

This, or copying directly into the table, should work fine. Per the
documentation:

"COPY FROM will invoke any triggers and check constraints on the
destination table. However, it will not invoke rules."
 (http://www.postgresql.org/docs/8.4/interactive/sql-copy.html)

--
Joshua Tolley   eggyknap
End Point Corporation