Re: Truncate Triggers - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: Truncate Triggers
Date
Msg-id 37ed240d0801251631w14b2a5dbq2c1c9cb7f8839cb4@mail.gmail.com
Whole thread Raw
In response to Re: Truncate Triggers  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
On Jan 26, 2008 8:14 AM, Gregory Stark <stark@enterprisedb.com> wrote:
> This two-faced personality is just why we're facing this problem. It looks to
> users like DML but it under the hood it behaves just like DDL.
>

Agreed that it looks like DML.  Speaking as a user, I came away from
the documentation thinking that "TRUNCATE foo;" was just a quicker (to
type as well as to run) alternative to "DELETE * FROM foo;".  Plus it
has the handy quality of being able to empty multiple tables in the
one command.

> I think there are two strategies here. Either we paper over the DDLishness by
> making it look as much as possible like DML. It'll never be perfect but we'll
> be as friendly as we can for users. That might just make the DDLishness pop up
> at all the more surprising moments and be all that much harder to explain
> though.
>
> Or we can just declare it DDL and put a warning in the documentation that
> while it may sound like it's DML it is in fact better thought of as a shortcut
> for doing DROP and CREATE and should be used as such.
>

It's my humble opinion that the analogy to DROP + CREATE does need to
be made more clear.

Cheers
BJ


pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: we have out func for typecast, but we missing this read function
Next
From: Stephen Frost
Date:
Subject: Re: Truncate Triggers