From: Radoulov, Dimitre <cichomitiko@gmail.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Issue with delete
Date: Thu, 24 Jun 2021 16:03:22 +0200
Message-ID: <34da09ed-97a9-557d-6d92-54c22fc5bc82@gmail.com> (raw)
In-Reply-To: <651524086.2768711.1624527250102@mail.yahoo.com>
References: <266147493.2758919.1624525689006.ref@mail.yahoo.com>
<266147493.2758919.1624525689006@mail.yahoo.com>
<ac5513c0-1b0e-ba7e-81fd-27c41d9d5ea1@jakobs.com>
<651524086.2768711.1624527250102@mail.yahoo.com>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: cichomitiko@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Issue with delete
In-Reply-To: <34da09ed-97a9-557d-6d92-54c22fc5bc82@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox