Re: Truncate Triggers

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Truncate Triggers
Date: 2008-01-26 00:31:19
Message-ID: 37ed240d0801251631w14b2a5dbq2c1c9cb7f8839cb4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jan 26, 2008 8:14 AM, Gregory Stark <stark(at)enterprisedb(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2008-01-26 01:23:22 Re: Truncate Triggers
Previous Message Pavel Stehule 2008-01-26 00:16:23 Re: we have out func for typecast, but we missing this read function