pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Delete a table automatic?
Date: Tue, 1 Nov 2022 07:41:14 -0600
Message-ID: <b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.com> (raw)
In-Reply-To: <CACJufxEbBvqxx_=a4_z2k2_UQiOxN6YnWC8cMGurYWR0wJKd7w@mail.gmail.com>
References: <CAKgrFs-PWb3O+aR==f1YYi+ehaBVyuAvy6H3dqwR3NAq9qeGqA@mail.gmail.com>
	<CACJufxEbBvqxx_=a4_z2k2_UQiOxN6YnWC8cMGurYWR0wJKd7w@mail.gmail.com>

On 11/1/22 03:31, jian he wrote:
>
>
> On Tue, Nov 1, 2022 at 2:33 PM 黄宁 <huangning0722@gmail.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
>
>

view thread (7+ messages)  latest in thread

Message-ID: <b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.com>
Permalink:  ../b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.com/
Also on:    postgresql.org/message-id/b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: Delete a table automatic?
  In-Reply-To: <b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.com>
  References: <CAKgrFs-PWb3O+aR==f1YYi+ehaBVyuAvy6H3dqwR3NAq9qeGqA@mail.gmail.com> <CACJufxEbBvqxx_=a4_z2k2_UQiOxN6YnWC8cMGurYWR0wJKd7w@mail.gmail.com> <b1e0a28e-f4f7-fd93-acc4-82cc46d9aae9@gmail.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