Re: ON COMMIT and foreign keys

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: ON COMMIT and foreign keys
Date: 2004-11-06 18:39:28
Message-ID: 20041106183928.GA17780@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> > > Incidentally ("collateral damage"), the patch modifies the TRUNCATE
> > > command so that it can work on multiple tables. In particular, if
> > > foreign key references are all internal to the group that's being
> > > truncated, the command is allowed.
> >
> > I think this is a feature addition that you've cleverly managed to
> > present as a bug fix ;-). While I like the feature, I've got very
> > mixed emotions about applying it this late in beta.

Ok, you caught me :-) Actually, I developed the patch thinking only on
the multi-relation TRUNCATE, with the goal of having it for 8.1. Only
after I prepared a first patch I noticed the temp-table-FKs problem.

So I don't really care if it has to wait for 8.1 because that was the
original intention anyway.

> > OTOH, multiple TRUNCATE would be a useful feature --- it came up
> > just the other day.

Right, that's why I did it in the first place.

On Sat, Nov 06, 2004 at 12:56:24AM -0500, Bruce Momjian wrote:

> Alvaro, would you post the patch skipping whitespace changes. As posted
> the patch does look very large, as you suggested.

Ok, turns out it wasn't that much smaller anyway :-) But really it's
only stashing a couple of foreach loops in two places, which is a fairly
trivial change; and the other important part is the modification of
heap_truncate_check_FKs and it's fairly localized anyway.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Aprender sin pensar es inútil; pensar sin aprender, peligroso" (Confucio)

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-11-06 19:18:57 Re: cygwin build failure
Previous Message Andrew Dunstan 2004-11-06 18:35:30 cygwin build failure