Re: Feature request: Truncate table - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: Feature request: Truncate table
Date
Msg-id 3D086B49.A870C581@mascari.com
Whole thread Raw
In response to Re: Feature request: Truncate table  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne wrote:
> 
> > > Hrm - last time I checked it did...
> >
> > Two questions :
> >
> > When was the last time ?
> 
> 7.1
> 
> > It did what ?
> 
> Drops triggers and stuff.
> 
> OK, I did a check and it looks like it's fixed in 7.2 at least.  Sorry for
> the false alarm...

It has never "dropped triggers and stuff", so there was nothing to fix.
All TRUNCATE TABLE has ever done, since the patch was submitted, was to
truncate the underlying relation file and the associated index files,
and reinitialize the indexes. It has been changed to be disallowed in
transactions involving tables not created in the same transaction, but
that's about it. People have argued that if there are *RI* triggers on a
table, that TRUNCATE should be disallowed, as in Oracle. But TRUNCATE
from inception to date has never dropped triggers...

Mike Mascari
mascarm@mascari.com


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Feature request: Truncate table
Next
From: Michael Meskes
Date:
Subject: Re: PostGres Doubt