Re: Feature suggestions (long)

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Feature suggestions (long)
Date: 2003-05-19 13:58:24
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4961FB4@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > What you need is one view that is a union all select selecting all
your
> > partial tables, all applications only accesses this one view. You
need 1
> > insert 2 update 1 delete rule for each table plus 3 remainder rules
(=4*N
> > + 3 rules) (the select rule is already done by create view), plus
one
> > check constraint for each partial table.
>
> WOW! You *are* good. Care to reveal the trick? I can see the insert
and
> delete rules but what are you doing for the updates?

The update needs one for the case where the tuple stays in the same
partial table,
and the second for moving it to another table. The first is simple
(where old.x = new.x),
the second must delete the original and insert a new row into the view.
The view insert
rule handles the distribution (might be, that there are TODO's here, my
data stays in
place). The additional problem with the second rule is, that the
returned UPDATE tag (iirc)
does not return the correct number of rows (deleted + inserted rows, see
lengthy thread
about the return tag). Whether that is an actual problem will depend on
your apps.

Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-05-19 14:24:05 Re: Heads up: 7.3.3 this Wednesday
Previous Message Greg Sabino Mullane 2003-05-19 13:28:41 Removing width from EXPLAIN