---
name: "truncate"
section: "7"
platform: "linux"
package: "postgresql"
version: "7.4.7-6sarge6"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/truncate/7"
---

# truncate(7)

empty a table

## NAME

TRUNCATE - empty a table

## SYNOPSIS

```
TRUNCATE [ TABLE ] name

```

## DESCRIPTION

**TRUNCATE** quickly removes all rows from a table. It has the same effect as an unqualified **DELETE** but since it does not actually scan the table it is faster. This is most useful on large tables.

## PARAMETERS

- *name*

  The name (optionally schema-qualified) of the table to be truncated.

## NOTES

**TRUNCATE** cannot be used if there are foreign-key references to the table from other tables. Checking validity in such cases would require table scans, and the whole point is not to do one.

**TRUNCATE** will not run any user-defined ON DELETE triggers that might exist for the table.

## EXAMPLES

Truncate the table bigtable:

```
TRUNCATE TABLE bigtable;

```

## COMPATIBILITY

There is no **TRUNCATE** command in the SQL standard.
