From: Rohit Rajput <rht.rajput@yahoo.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
To: Holger Jakobs <holger@jakobs.com>
Subject: Re: Issue with delete
Date: Thu, 24 Jun 2021 09:34:10 +0000 (UTC)
Message-ID: <651524086.2768711.1624527250102@mail.yahoo.com> (raw)
In-Reply-To: <ac5513c0-1b0e-ba7e-81fd-27c41d9d5ea1@jakobs.com>
References: <266147493.2758919.1624525689006.ref@mail.yahoo.com>
<266147493.2758919.1624525689006@mail.yahoo.com>
<ac5513c0-1b0e-ba7e-81fd-27c41d9d5ea1@jakobs.com>
Thanks Holger. My bad. appreciate it.
On Thursday, 24 June, 2021, 02:53:02 pm IST, Holger Jakobs <holger@jakobs.com> wrote:
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);
where i run this, i get following error:
Error: current transaction is aborted, commands ignored until end of transaction block. SQL state: 25P02.
I am running it in RDS.
TIA, Best, Rohit
This message stems from a previous error within the same transaction. Unlike Oracle, PostgreSQL cannot execute commands within a transaction after an error has occurred.
Make sure that this statement is the first in your transaction or use it in autocommit mode.
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
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: rht.rajput@yahoo.com, pgsql-admin@lists.postgresql.org, holger@jakobs.com
Subject: Re: Issue with delete
In-Reply-To: <651524086.2768711.1624527250102@mail.yahoo.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