Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 29A8C2E2EFE for ; Mon, 14 Jan 2008 05:45:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 17121-05 for ; Mon, 14 Jan 2008 05:45:00 -0400 (AST) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by postgresql.org (Postfix) with ESMTP id 25A1F2E2E77 for ; Mon, 14 Jan 2008 05:44:59 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id 22so2075700fge.23 for ; Mon, 14 Jan 2008 01:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=xMsWXoCkYGq5c4ygtV6Jo4hF5f28KdNYI3AOJ6MB1W8=; b=gNnK6KIsY2a/NX2/XYhfEJLVlU5Tn5m69fRRUOmHJraYUey6XEMpx5U4qjWeil7VoOXQzMkFoRPTA61KsC1y3a+jdB+/tKfy+NsB60pMeL9bwRjuYW7iRnf1z1Gb1Tneuwpmda/+dPL6WlOwgifhq0Hk2brGlEsDSybKjBziRJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SE0I8aF8H5q4WVjY5z14Cld960kw8c0+m7V1SSotick3Ic8x+vdJtFfsEK0WZKOGlidRIjQWr1OReVGN+S9Lj63IlZhgiF7DOEk1uaDNZ8ID7xOMSXwCxB4TdVjQ4sWXrGhd8TaFBrhrER9beZaf8fkK2YyxWRObkJmjRx8wg4U= Received: by 10.78.170.6 with SMTP id s6mr6883604hue.50.1200303898704; Mon, 14 Jan 2008 01:44:58 -0800 (PST) Received: by 10.78.150.15 with HTTP; Mon, 14 Jan 2008 01:44:58 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 09:44:58 +0000 From: "Peter Childs" To: pgsql-sql@postgresql.org Subject: Re: trigger for TRUNCATE? In-Reply-To: <1200069700.4266.1156.camel@ebony.site> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7904_33358981.1200303898702" References: <4783BEA9.3020507@fmed.uba.ar> <60tzloyr0u.fsf@dba2.int.libertyrms.com> <162867790801081338n237497efpecffaa255253274d@mail.gmail.com> <47864A6B.3070902@fmed.uba.ar> <20080110171027.GK6465@alvh.no-ip.org> <8003.1199986734@sss.pgh.pa.us> <20080110174705.GO6465@alvh.no-ip.org> <9563.1199992524@sss.pgh.pa.us> <478727C3.3090301@archonet.com> <1200069700.4266.1156.camel@ebony.site> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/108 X-Sequence-Number: 29961 ------=_Part_7904_33358981.1200303898702 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/01/2008, Simon Riggs 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. ------=_Part_7904_33358981.1200303898702 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 11/01/2008, Simon Riggs <simon@2ndquadrant.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.
------=_Part_7904_33358981.1200303898702--