Thread: TRUNCATE statement patch

TRUNCATE statement patch

From
Marcus Mascari
Date:
Hello,

The following is a patch which patches cleanly
against the 6.5 release and which implement's
Oracle's TRUNCATE statement.

There are a few things to note about this patch:

1. It mirrors the operation of VACUUM in that it
   acquires an Access Exclusive lock on the relation
   being TRUNCATE'd (as well as its indexes, as
   necessary).

2. It currently does not update pg_class with either
   the "bogus" stats of 1000 tuples nor does it set
   the number of tuples to 0.

3. You must have pg_ownercheck() permissions to
   TRUNCATE a table.

I hope the PostgreSQL professionals can clean
this up sufficient enough to be useful to the rest
of the world (I find it increasingly useful as we
add more and more users).

Marcus "Mike" Mascari (mascarim@yahoo.com)




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Attachment