Pivotal Knowledge Base


New "Truncate" Behavior Introduced from Greenplum


Pivotal Greenplum (GPDB) 4.3.3 and above


The "Grant" and "Revoke" commands support the "Truncate" privilege on a table. This is one of the new features of Pivotal Greenplum, per release notes.
You can use the "Grant" and "Revoke" commands to allow or prohibit a GPDB role (or a user) from removing all the rows in a table with the "Truncate" command.

If you grant privileges directly to a role on a certain table and then upgrade from a previous release to or higher, that role will not be able to truncate that table. Even if it's the owner of that table, unless you explicitly grant truncate on that table after the upgrade, the table would not be truncated.

If you do not grant privileges directly to a role, after the upgrade that role will still be able to truncate a table if it is the owner of that table.


Once the privilege bitmap (technically "ACL array") has been initialized for a specific table/role,"Truncate" will be denied unless it is set to True.

If the bitmap has not been initialized, by default a table owner will still be able to truncate its tables.


For minor upgrades (e.g. from 4.3.x to or higher), a script will be provided to grant truncate automatically to all users that are table-owners, only on the tables they own. Customers will be responsible for running this script. See attached script UpdateTruncateForOwner.sh

For major upgrades (e.g. from 4.2.x to or higher), this script will run automatically during the upgrade, via gpmigrator.


Powered by Zendesk