Re: Partitioning triggers doc patch

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jaime Casanova" <jaime(at)2ndquadrant(dot)com>
Cc: "Rural Hunter" <ruralhunter(at)gmail(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Partitioning triggers doc patch
Date: 2012-03-12 17:39:38
Message-ID: 4F5DEE8A0200002500046173@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jaime Casanova <jaime(at)2ndquadrant(dot)com> wrote:
> On Mon, Mar 12, 2012 at 10:41 AM, Kevin Grittner
> <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
>> Attached is a doc patch based on a suggestion by Rural Hunter to
>> address something he found confusing while setting up
>> partitioning.
>>
>> Original thread is here:
>>
>> http://archives.postgresql.org/pgsql-admin/2012-03/msg00066.php
>>
>
> you can create trigger that execute before the trigger that
> redirect to the partition, for example to stamp the time or the
> user... so it should state something like i said about constraints
>
> """
> Do not define any check constraints on this table, unless you
> intend them to be applied equally to all partitions.
> """

Yeah, I thought about that issue, but the problem is that the rule
or trigger that routes the operation to another partition might
prevent the trigger from firing at all. I figured that if I went as
far as what you describe, I would need to get into those timing
issues, too; and I wasn't sure whether that might be "too much
information" for that particular spot. But if you think we should
go there, I could draft something which pointed out that an AFTER
trigger is never useful and that a BEFORE trigger to enforce things
globally must sort ahead of the "routing" trigger, and should not be
used at all if a RULE is used to route operations to the partitions.

Do we really want to get into all that in the middle of step-by-step
instructions for the simple case?

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-12 17:39:45 Re: [v9.2] Add GUC sepgsql.client_label
Previous Message Jaime Casanova 2012-03-12 17:31:21 Re: Partitioning triggers doc patch