Skip to content
masterclass Buddy

PostgreSQL · Command

TRUNCATE

TRUNCATE removes all rows from one or more PostgreSQL tables without scanning them. It immediately reclaims table space and can reset owned sequences or include foreign-key-dependent tables.

Last updated

Syntax

TRUNCATE [ TABLE ] [ ONLY ] name [ * ] [, ... ] [ RESTART IDENTITY | CONTINUE IDENTITY ] [ CASCADE | RESTRICT ]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • DELETE
  • VACUUM
  • ALTER SEQUENCE
  • ON TRUNCATE triggers
  • foreign keys

Source: PostgreSQL: Documentation: 18: TRUNCATE. Checked 2026-11-03.