Keep in mind if you have multiple rules for a master table, it won't return the number of affected rows as you might expect. This screws up Hibernate which I'm using for my application. It checks the return value to make sure it was inserted properly. Luckily I only need one rule which puts it into the "current" child table (im partitioning on current timestamp). I suppose I could get around this by using a stored procedure or something but that would not be as portable. I'm looking forward to future versions of PG which automate more of the partitioning features :) keep up the good work!


On 8/20/06, Tom Lane <[EMAIL PROTECTED]> wrote:
"April Lorenzen" <[EMAIL PROTECTED]> writes:
> My suggestion is to allow specifying a default destination table in
> the master partition table definition. This default destination table
> could be changed with ALTER TABLE.

The recommended way to do this is with an ON INSERT DO INSTEAD rule
on the master table.  The advantage of using rules is that you can have
several conditional rules to ensure that insertions go into the right
sub-tables, whereas a default would likely just fail :-(

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Eugene Hart

Reply via email to