Re: Partitioned tables and triggers

From: Chetan Suttraway <chetan(dot)suttraway(at)enterprisedb(dot)com>
To: mephysto <mephystoonhell(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Partitioned tables and triggers
Date: 2012-04-17 07:28:14
Message-ID: CAPtHcnFDLKn_ONYbv1P4TO0gtLwGkYdbKLJT9h8gjD1q=sZ7_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Apr 6, 2012 at 12:26 PM, mephysto <mephystoonhell(at)gmail(dot)com> wrote:

> Hello to everyone, yesterday I created my first montly partitioned table
> with
> its insert trigger following the specific manual page.
>
> At the moment table seems to work correctly, but I have some doubts:
>
> 1 - After an insert operation, I can see data either in master and in child
> table. Is this a normal behavior?
>

WRT data in master table, different people/setup have different strategies.
For ex: in case of oracle, there is no data in master table. All the data
comes from partitions.

> 2 - I created only insert trigger, but not update and delete. Do I need
> also
> these triggers to managing data correctly?
>

Yes.
Note that In case you are allowing to update the key values and it may
happen to move to another partition,
then you need to take care of this row movement.

3 - When a BEFORE INSERT trigger function execute in its turn an INSERT
> operation, are the origina INSERT executed or not? Are the data inserted in
> master table also, and not only in child table?
>
> Thanks in advance.
>

Regards,
Chetan

--
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Website: www.enterprisedb.com
EnterpriseDB Blog : http://blogs.enterprisedb.com
Follow us on Twitter : http://www.twitter.com/enterprisedb

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Roberto Caravani 2012-04-17 17:46:26 unique constraint
Previous Message Merlin Moncure 2012-04-16 19:57:11 Re: Visual FoxPro (VFP) 9 Migration Strategy to Postgresql on Linux