Re: Issue with delete - Mailing list pgsql-admin

From Radoulov, Dimitre
Subject Re: Issue with delete
Date
Msg-id 34da09ed-97a9-557d-6d92-54c22fc5bc82@gmail.com
Whole thread Raw
In response to Re: Issue with delete  (Rohit Rajput <rht.rajput@yahoo.com>)
Responses Re: Issue with delete
List pgsql-admin


Am 24.06.21 um 11:08 schrieb Rohit Rajput:
Good day everyone,

I have few tables where i need to delete above 50 million rows each. Since i dont want to delete them all in one shot and block my table for extended time, i am trying to use limit with delete but its giving me error every time. May i please get some assistance here? Thanks

Here is what i am running:

delete from mytable where id in (select id from mytable where condition=true limit 1000);


Wouldn't "delete from mytable where condition=true limit 1000" be sufficient?


Regards
Dimitre

pgsql-admin by date:

Previous
From: Rohit Rajput
Date:
Subject: Re: Issue with delete
Next
From: Guillaume Lelarge
Date:
Subject: Re: Issue with delete