Re: managing table partitions automatically - Mailing list pgsql-novice

From Joshua Tolley
Subject Re: managing table partitions automatically
Date
Msg-id 20081113172054.GH22032@polonium.part.net
Whole thread Raw
In response to managing table partitions automatically  ("Ertel, Steve" <Steve.Ertel@infimatic.com>)
List pgsql-novice
On Thu, Nov 13, 2008 at 10:33:11AM -0600, Ertel, Steve wrote:
> I realize that I could do this from a background process.  The problem
> is that a user may create a record where the start_time is further in
> the future or the past than I have tables to hold it.  The application
> that I am working on contains schedule functionality that allows people
> to schedule events for an unlimited time into the future.
>
> I could create a TRIGGER or RULE that would be executed for each insert
> that checks for a tables existence, but how do I control the order that
> the rules or triggers are executed in?
>
> Steve

1) Please avoid top-posting
2) Use triggers instead of rules wherever possible
3) From the docs: "If more than one trigger is defined for the same
event on the same relation, the triggers will be fired in alphabetical
order by trigger name. In the case of before triggers, the
possibly-modified row returned by each trigger becomes the input to the
next trigger. If any before trigger returns NULL, the operation is
abandoned for that row and subsequent triggers are not fired."

- Josh / eggyknap

Attachment

pgsql-novice by date:

Previous
From: "Obe, Regina"
Date:
Subject: Re: managing table partitions automatically
Next
From: "Ertel, Steve"
Date:
Subject: Re: managing table partitions automatically