Re: Issue with delete

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: "Radoulov, Dimitre" <cichomitiko(at)gmail(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Issue with delete
Date: 2021-06-24 14:48:40
Message-ID: CAECtzeXYjbgaVKyuEjKsmTBJBFA3i0sZz94ZC074PyqgTO0OkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Le jeu. 24 juin 2021 à 16:02, Radoulov, Dimitre <cichomitiko(at)gmail(dot)com> a
écrit :

>
> 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?
>
>
>
That syntax doesn't exist.

--
Guillaume.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Radoulov, Dimitre 2021-06-24 14:55:13 Re: Issue with delete
Previous Message Radoulov, Dimitre 2021-06-24 14:03:22 Re: Issue with delete