Re: count on cascading deletes

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "eildert(dot)groeneveld(at)fli(dot)bund(dot)de" <eildert(dot)groeneveld(at)fli(dot)bund(dot)de>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: count on cascading deletes
Date: 2014-09-05 18:15:28
Message-ID: 1409940928.44534.YahooMailNeo@web122304.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eildert Groeneveld <eildert(dot)groeneveld(at)fli(dot)bund(dot)de> wrote:

> prior to issuing a cascading delete in an interactive program
> I would like to retrieve from Postgresql what is involved in the
> particular delete, so that this can be printed to the console
> and the user can be asked:
>
> This is what your delete would do in the database:
> deleting panel = 123 would imply deleting the following children:
> in foo: 123 records
> in fuu: 123456 records
>
> do you really want to do this? (y/N)
>
> As this is a general problem, I would assume, that someone has written
> a function that would do that. Unfortunately, no luck with google.

Do you want to block anyone who attempts to modify data such that
the counts might become different, for an indefinite amount of time
waiting for a response to this question? Or would you rather that
the actual delete when they say Y potentially do something very
different from what the prompt is asking?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-09-05 18:22:42 Re: count on cascading deletes
Previous Message Cal Heldenbrand 2014-09-05 17:31:30 Querying a time range across multiple partitions