Created
June 15, 2018 14:57
-
-
Save nara-l/0ec2e69fcebbcc1f3b3b515c25b80d8a to your computer and use it in GitHub Desktop.
Postgres empty table using TRUNCATE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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