Re: Partitioning option for COPY - Mailing list pgsql-hackers

From Emmanuel Cecchet
Subject Re: Partitioning option for COPY
Date
Msg-id 4B0BF6F1.8050300@asterdata.com
Whole thread Raw
In response to Re: Partitioning option for COPY  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Partitioning option for COPY
Re: Partitioning option for COPY
List pgsql-hackers
Itagaki Takahiro wrote:
> I just edited a wiki page for this discussion.
> I hope it can be a help.
> http://wiki.postgresql.org/wiki/Table_partitioning
>   
I guess the problem of handling user triggers is still open.
If we allow triggers on partitions, badly written logic could lead to 
infinite loops in routing. In the case of COPY, an after statement 
trigger could change all the routing decisions taken for each row. I am 
not sure what the semantic should be if you have triggers defined on the 
parent and child tables. Which triggers do you fire if the insert is on 
the parent table but the tuple ends up in a child table?
If the new implementation hides the child tables, it might be safer to 
not allow triggers on child tables altogether and use the parent table 
as the single point of entry to access the partition (and define 
triggers). With the current proposed implementation, would it be 
possible to define a view using child tables?

Emmanuel

-- 
Emmanuel Cecchet
Aster Data
Web: http://www.asterdata.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Next
From: Michael Meskes
Date:
Subject: Re: [INTERFACES] ecpg & 8.3 -> 8.4 migration