Re: trigger for TRUNCATE?

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: trigger for TRUNCATE?
Date: 2008-01-14 09:44:58
Message-ID: a2de01dd0801140144s5e35612cw854e79a91ae871a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 11/01/2008, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>
> On Fri, 2008-01-11 at 08:24 +0000, Richard Huxton wrote:
>
> > I've always considered TRUNCATE to be DDL rather than DML. I mentally
> > group it with DROP TABLE rather than DELETE>
>
> DDL/DML probably isn't the right split, since its then arguable as to
> which group of commands it belongs in.
>
> I see we have 3 types of commands:
>
> 1. Commands that alter the rows in the table
> e.g. UPDATE, DELETE, INSERT + TRUNCATE is clearly part of this group

I'm not sure Truncate currently 100% fits into this group but I think it
should, ought to, or even might.

2. Commands that change the shape of a table
> e.g. ALTER TABLE add/drop column, change type, constraints etc

Create table, drop table, foreign keys, unique indexes, and (currently)
truncate (in that is currently the same as a drop followed by a create) also
fit into this group

3. Commands that change the environment of a table
> e.g. foreign keys, indexes, grants, set fillfactor, ANALYZE, VACUUM,
> CLUSTER etc
>

ie commands that don't effect the shape of the table or the data in the
table only the speed and security or the table so foreign keys don't really
fit in this class nor do unique indexes.

Peter.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message RDyes 2008-01-14 14:17:47 Unescaping text or binary file
Previous Message Marc Mamin 2008-01-14 08:57:27 Re: SQL stored function inserting and returning data in a row.