Re: PostgreSQL - Ordering Table based of Foreign Key

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: FOUTE K(dot) Jaurès <jauresfoute(at)gmail(dot)com>
Cc: Andreas Joseph Krogh <andreas(at)visena(dot)com>, Thomas Kellerer <shammat(at)gmx(dot)net>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL - Ordering Table based of Foreign Key
Date: 2021-10-03 17:00:11
Message-ID: 85d5c6d9-f3df-a3f1-7c6a-c5f6f97b538a@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/3/21 9:24 AM, FOUTE K. Jaurès wrote:

Please don't top post, inline/bottom posting is the preferred style on
this list.

> I need to delete data from about 100 table in the production system for
> a specific client without stopping application.

Honestly that is not that much more informative.

So:

1) Do the FK's have "ON DELETE CASCADE" already?

2) Does a single FK cascade through all 100 tables or are there groups
of parent/child tables and associated FK's

3) Show an example DELETE query and tables affected.

>
> On Sun, 3 Oct 2021, 17:19 Adrian Klaver, <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
> On 10/3/21 7:40 AM, FOUTE K. Jaurès wrote:
> > Thanks for your input but I want to make a delete with where clause
>
> Then Thomas Kellerer's suggestion of having "ON DELETE CASCADE" on the
> FK would seem to be what you need. If not then you will need to provide
> more information about what you are trying to achieve?
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-10-03 17:03:33 Re: pg_dump save command in output
Previous Message Joao Miguel Ferreira 2021-10-03 16:56:38 pg_dump save command in output