Re: --//pgsql partitioning-///-------------------- - Mailing list pgsql-general

From Vick Khera
Subject Re: --//pgsql partitioning-///--------------------
Date
Msg-id 2968dfd60911040659w7014ec19o1fdd2d174e48e6c7@mail.gmail.com
Whole thread Raw
In response to --//pgsql partitioning-///--------------------  (shahrzad khorrami <shahrzad.khorrami@gmail.com>)
Responses Re: --//pgsql partitioning-///--------------------  ("Ow Mun Heng" <ow.mun.heng@wdc.com>)
List pgsql-general
On Wed, Nov 4, 2009 at 4:49 AM, shahrzad khorrami
<shahrzad.khorrami@gmail.com> wrote:
>  but problem here is how I can do something that when I insert data, the
> master table remains empty
> and just data inserted into inherited tables.
>

Here are two (not necessarily mutually exclusive) options for you:

1) use triggers/rules on the master table and do all your inserts
directed to it and have the trigger/rule do the right thing
2) write your insert/update/delete statements to use the correct
inherited table directly, and write a trigger on the master that
denies any inserts.

Did you read the documentation on partitions?  It covers this.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Could not read directory "pg_xlog": Invalid argument (on SSD Raid)
Next
From: Joshua Tolley
Date:
Subject: Re: createlang error(s)