Re: questions about very large table and partitioning

From: Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com>
To: Erik Jones <erik(at)myemma(dot)com>
Cc: fdu(dot)xiaojf(at)gmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: questions about very large table and partitioning
Date: 2008-02-18 18:41:17
Message-ID: 08B46AFB-6CEB-46A6-9A61-E0BEC9334FD1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Il giorno 18/feb/08, alle ore 18:42, Erik Jones ha scritto:

>
> On Feb 18, 2008, at 11:23 AM, Enrico Sirola wrote:
>
>>
>> Il giorno 18/feb/08, alle ore 17:37, fdu(dot)xiaojf(at)gmail(dot)com ha scritto:
>>> 1) PostgreSQL only support partition by inheritance, and rules
>>> have to
>>> be created for each child table, this will result *a lot of* rules
>>> if
>>> the number of child tables is large.
>>>
>>> Are there some smart ways to avoid this kind of mass ?
>>
>> you can obtain the same result using a trigger, but you must
>> replace the trigger function every time you add/remove a partition.
>
> This is not strictly true. If you use EXECUTE to run dynamically
> built INSERT/UPDATE/DELETE statements you don't have to replace the
> trigger each time.

oh sure, in that case you can, but I do the opposite way: dynamically
generate the trigger function with a plpgsql script at partition-
creation time :-)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Niantschur 2008-02-18 18:50:25 Re: How to return a large String with C (solved)
Previous Message Steve Atkins 2008-02-18 18:16:35 Re: Auto incrementing primary keys