Re: TRUNCATE

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TRUNCATE
Date: 2002-05-12 16:40:09
Message-ID: 02ef01c1f9d3$ae4ea590$0f02000a@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rod Taylor" <rbt(at)zort(dot)ca>
Cc: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Sent: Sunday, May 12, 2002 12:30 PM
Subject: Re: [HACKERS] TRUNCATE

> "Rod Taylor" <rbt(at)zort(dot)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
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2002-05-12 17:23:32 Re: Nested transactions RFC
Previous Message Tom Lane 2002-05-12 16:30:25 Re: TRUNCATE