Skip to content

Instantly share code, notes, and snippets.

@nara-l
Created June 15, 2018 14:57
Show Gist options
  • Save nara-l/0ec2e69fcebbcc1f3b3b515c25b80d8a to your computer and use it in GitHub Desktop.
Save nara-l/0ec2e69fcebbcc1f3b3b515c25b80d8a to your computer and use it in GitHub Desktop.
Postgres empty table using TRUNCATE
# using truncate
TRUNCATE TABLE table_name RESTART IDENTITY; # to reset index counts
TRUNCATE TABlE table_name CASCADE; # to delete foreign key dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment