Re: --//pgsql partitioning-///--------------------

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: --//pgsql partitioning-///--------------------
Date: 2009-11-04 14:59:53
Message-ID: 2968dfd60911040659w7014ec19o1fdd2d174e48e6c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 4, 2009 at 4:49 AM, shahrzad khorrami
<shahrzad(dot)khorrami(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michal Bicz 2009-11-04 15:32:33 warm standby resume and take online problems
Previous Message Tom Lane 2009-11-04 14:48:28 Re: Could not read directory "pg_xlog": Invalid argument (on SSD Raid)