Re: about truncate

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Subject: Re: about truncate
Date: 2008-12-30 18:00:02
Message-ID: 871vvpr1b1.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:

> Tom Lane wrote:
>> My vote is to just go ahead and change it. I don't really see much
>> of a use-case for truncating only the parent of an inheritance
>> hierarchy anyway, so I doubt that many people would be affected.

agreed.

>> I note though that we have a lot of other non-recursive maintenance
>> operations (CLUSTER, some variants of ALTER TABLE, etc) ... are we
>> going to try to make them all recursive?
>
> Uh, good question. ;-) I think fixing TRUNCATE makes sense because it
> is similar to DELETE (it operates on the data), but I see ALTER TABLE
> and CLUSTER as per-table operations that people would not expect to ever
> recurse, i.e. TRUNCATE is like DELETE without a WHERE clause, but
> CLUSTER or ALTER TABLE have no DML equivalents.

What does the standard say about ALTER TABLE and inheritance? It seems like it
would be hard to make ALTER TABLE recursive since, while some operations might
make sense, others will depend on the current state of the table and that
might be very different for different children.

Likewise CLUSTER ON/USING doesn't make much sense to be recursive since the
index names will be different. It might be handy to have a recursive version
of the command to recluster an already clustered table though.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2008-12-30 18:13:36 Re: Documenting serializable vs snapshot isolation levels
Previous Message Simon Riggs 2008-12-30 17:58:15 Re: Documenting serializable vs snapshot isolation levels