Re: TRUNCATE - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: TRUNCATE
Date
Msg-id 02ef01c1f9d3$ae4ea590$0f02000a@jester
Whole thread Raw
In response to TRUNCATE  ("Rod Taylor" <rbt@zort.ca>)
List pgsql-hackers
The only time I can think of that a FORCE type mechanism would be
allowed would be internal functions.  Perhaps a new cluster (copy
data, truncate table, copy data back sorted).

Internal stuff can call heap_truncate() directly rather than going
through TruncateRelation.

A user style force is to simply drop all rules, foreign keys,
triggers, etc -- do the action -- re-apply constraints.  Anything else
could mean their data isn't consistent.

--
Rod
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Rod Taylor" <rbt@zort.ca>
Cc: "Hackers List" <pgsql-hackers@postgresql.org>
Sent: Sunday, May 12, 2002 12:30 PM
Subject: Re: [HACKERS] TRUNCATE


> "Rod Taylor" <rbt@zort.ca> writes:
> > I'm thinking it should check for an on delete rule as well as user
> > triggers.
>
> Seems reasonable to me.
>
> Should there be a "FORCE" option to override these checks and do it
> anyway?  Or is that just asking for trouble?
>
> regards, tom lane
>



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TRUNCATE
Next
From: Stephan Szabo
Date:
Subject: Re: Nested transactions RFC