pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rohit Rajput <rht.rajput@yahoo.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Issue with delete
Date: Thu, 24 Jun 2021 09:08:09 +0000 (UTC)
Message-ID: <266147493.2758919.1624525689006@mail.yahoo.com> (raw)
References: <266147493.2758919.1624525689006.ref@mail.yahoo.com>

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

view thread (7+ messages)  latest in thread

Message-ID: <266147493.2758919.1624525689006@mail.yahoo.com>
Permalink:  ../266147493.2758919.1624525689006@mail.yahoo.com/
Also on:    postgresql.org/message-id/266147493.2758919.1624525689006@mail.yahoo.com

 · 

reply

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
  Subject: Re: Issue with delete
  In-Reply-To: <266147493.2758919.1624525689006@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