Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 3684

An operation that removes all rows in a table without causing any triggered action

6 votes
Accepted

"Truncate" or "Delete/Vacuum Full" for deleting some of the table rows

Read about temp_buffers in this related answer: Optimizing bulk update performance in PostgreSQL Truncate the table. Re-insert the survivors. This way, views stay intact. …
Erwin Brandstetter's user avatar
2 votes
Accepted

Approaches for deleting unnecessary records from tables

You seem to be misinterpreting a part of my advice to your previous question: so I can not Truncate and rename the temp_tables since the system should be on all the time. … After TRUNCATE you run an INSERT. The only blocking operation is the TRUNCATE. …
Erwin Brandstetter's user avatar
13 votes
Accepted

Truncate parent table but not children

Use the ONLY key word: TRUNCATE ONLY public.history_uint; The manual: If ONLY is specified before the table name, only that table is truncated. …
Erwin Brandstetter's user avatar
6 votes

Speed difference between Drop table and Truncate table in Postgres

And it gets smaller, yet if you factor in an additional ANALYZE that might be needed after TRUNCATE. Then again, you might need that in any case. … The manual: COPY is fastest when used within the same transaction as an earlier CREATE TABLE or TRUNCATE command. …
Erwin Brandstetter's user avatar