Re: default child of partition master

From: Gene <genekhart(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "April Lorenzen" <outboundindex(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: default child of partition master
Date: 2006-08-20 16:58:31
Message-ID: 430d92a20608200958q33d4ca0epaaeafe88747a8c20@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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!

Gene

On 8/20/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> "April Lorenzen" <outboundindex(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2006-08-20 17:21:19 Re: pg_dump versus SERIAL, round N
Previous Message Tom Lane 2006-08-20 16:09:29 Re: default child of partition master