TRUNCATE statement patch

From: Marcus Mascari <mascarim(at)yahoo(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: TRUNCATE statement patch
Date: 1999-06-30 20:23:03
Message-ID: 19990630202303.11022.rocketmail@web126.yahoomail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)yahoo(dot)com)

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

Attachment Content-Type Size
truncate_patch application/x-unknown 16.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Boyle 1999-06-30 20:44:05 Postgres Upsizing Tool for MSAccess 97
Previous Message Cary O'Brien 1999-06-30 19:48:01 Oracle and hot backups