How to Truncate a Table in PostgreSQL

Last updated July 24, 2026 · By the SaturnSQL team

TRUNCATE removes all rows instantly and, unlike MySQL, is transactional in Postgres: you can ROLLBACK it. Use RESTART IDENTITY to reset sequences and CASCADE for tables referenced by foreign keys.

TRUNCATE TABLE session_logs;

Reset sequences and cascade

TRUNCATE TABLE orders RESTART IDENTITY CASCADE;

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related PostgreSQL guides

© 2026 Panda Capital Oy Ab. All rights reserved.