Re: Delete a table automatic?

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Delete a table automatic?
Date: 2022-11-01 13:41:14
Message-ID: b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/1/22 03:31, jian he wrote:
>
>
> On Tue, Nov 1, 2022 at 2:33 PM 黄宁 <huangning0722(at)gmail(dot)com> wrote:
>
> I now have two tables named A and B. Table B is calculated based
> on the data of table A. I wonder if table B can be automatically
> deleted when table A is deleted?
>
>
> Your question seems not that specific.
> You can use https://dbfiddle.uk/btGcOH30 to showcase your specific
> problem/question.
>
> you can use DROP TABLE CASCADE.
> DROP TABLE manual:
> https://www.postgresql.org/docs/current/sql-droptable.html
>

Only If B has a foreign key reference to A
> --
>  I recommend David Deutsch's <<The Beginning of Infinity>>
>
> Jian
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2022-11-01 14:16:03 Re: Delete a table automatic?
Previous Message jian he 2022-11-01 09:31:52 Re: Delete a table automatic?