From: Radoulov, Dimitre <cichomitiko@gmail.com>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Issue with delete
Date: Thu, 24 Jun 2021 16:55:13 +0200
Message-ID: <7e32529f-5692-1838-8468-4b8deff424ea@gmail.com> (raw)
In-Reply-To: <CAECtzeXYjbgaVKyuEjKsmTBJBFA3i0sZz94ZC074PyqgTO0OkQ@mail.gmail.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>
<34da09ed-97a9-557d-6d92-54c22fc5bc82@gmail.com>
<CAECtzeXYjbgaVKyuEjKsmTBJBFA3i0sZz94ZC074PyqgTO0OkQ@mail.gmail.com>
On 24/06/2021 16.48, Guillaume Lelarge wrote:
> Le jeu. 24 juin 2021 à 16:02, Radoulov, Dimitre <cichomitiko@gmail.com
> <mailto:cichomitiko@gmail.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.
I should have tried the statement before asking, thanks!
I got confused by other databases (used it on Db2).
Best 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, guillaume@lelarge.info, pgsql-admin@lists.postgresql.org
Subject: Re: Issue with delete
In-Reply-To: <7e32529f-5692-1838-8468-4b8deff424ea@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