Transaction safe Truncate

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Transaction safe Truncate
Date: 2002-11-15 19:11:15
Message-ID: 1037387475.14810.116.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ok. Transaction safe truncate is simply transaction safe cluster
without the data copy and a slightly different set of permission checks.

I'd like to split cluster_rel() in cluster.c into 2 functions at line
174. The permission checks, locking, etc will remain in cluster_rel().
The bottom half will be turned into a function called
rebuild_rel(tableOid Oid, indexOid Oid, dataCopy bool).

If dataCopy is set to false, then indexOid may be null -- this will
truncate the table.

Cluster will set dataCopy to true which will maintain current
expectations for cluster.

I'll also move TruncateRelation into cluster.c.


PreCommit_on_commit_actions() -> ONCOMMIT_DELETE_ROWS is the only
location using heap_truncate(). It may be possible to change this and
remove heap_truncate() altogether.

--
Rod Taylor <rbt(at)rbt(dot)ca>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 2002-11-15 20:20:09 Re: Time to move on...
Previous Message Jason Tishler 2002-11-15 19:02:02 Re: [HACKERS] ipc-daemon