Re: list number of entries to be delete in cascading deletes

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: eildert(dot)groeneveld(at)fli(dot)bund(dot)de
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: list number of entries to be delete in cascading deletes
Date: 2014-02-11 20:58:03
Message-ID: CAGTBQpa-hSszXGgN8pQk2SzAE6X9p-_rDrmg_WwSNa7M7cJRog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Feb 11, 2014 at 5:54 PM, Eildert Groeneveld
<eildert(dot)groeneveld(at)fli(dot)bund(dot)de> wrote:
> Dear All
>
> this probably not the best list to post this question:
>
> I use cascading deletes but would like to first inform the user what she
> is about to do.
> Something like : explain delete from PANEL where panel_id=21;
> -- you are about to delete 32144 records in tables abc aaa wewew
>
> This is clearly something that can be programmed but as all information
> is available in the database schema, there should be a generalized
> procedure available.

Granted, this is somewhat ugly, but you could issue the delete, note
down the rowcount, and rollback.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2014-02-11 22:40:14 Re: [PERFORM] encouraging index-only scans
Previous Message Eildert Groeneveld 2014-02-11 20:54:04 list number of entries to be delete in cascading deletes