Answer the question
In order to leave comments, you need to log in
How to delete data in postgres?
Hello everyone
Guys, plz tell me how to delete a large amount of data from a table.
Escape, after reading on the Internet, I realized that if you just do delete, then everything will fall into place. It is advised to delete data in batches and then vacuum full. I'm not very familiar with the syntax of postgres, can someone tell me the command (I apologize for impudence and partly laziness) how to delete data in batches, by id for example
Thank you
z.s.
Googled this option
DELETE FROM [your table]
WHERE [ID] IN
(SELECT TOP 10000 * FROM [your table])
but have very little idea how to use it
Answer the question
In order to leave comments, you need to log in
If you need to completely clear the table, then
TRUNCATE ИМЯ_ТАБЛИЦЫ;
VACUUM FULL;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question