Yes, there is a good reason. As a trigger can update the tuple value,
this can change the routing decision. If you have a user trigger that
tries to change the key value after the partition choice has been made,
this will lead to an integrity constraint violation which is probably
not what the user expects.
Note that user triggers with partitions will be tricky anyway
(regardless of how partitioning is implemented, that is with triggers or
not). If 2 partitions have user triggers that update the key value to
bounce the tuple to the other partition you may end up with an infinite
I am not sure what the semantic of statement triggers (still user
triggers) should be on partitioned tables.
We will probably have to come up with restrictions on triggers so that
they can only be applied to the parent table and not on child tables to
prevent nasty issues.
Tom Lane wrote:
> In the case of the FK triggers, it's intentional (and maybe even
> documented) that users should be able to place their own triggers before
> or after the FK triggers. Is there a good reason why partitioning
> triggers should be different? If there is, maybe the feature shouldn't
> be implemented via triggers in the first place.
> regards, tom lane
Aster Data Systems
In response to
pgsql-hackers by date
|Next:||From: justin||Date: 2009-03-31 16:48:54|
|Subject: Re: [HACKERS] string_to_array with empty input|
|Previous:||From: Tom Lane||Date: 2009-03-31 16:21:52|
|Subject: Re: Solaris getopt_long and PostgreSQL |