Re: Delete a table automatic?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Delete a table automatic?
Дата
Msg-id e7aaa4f0-0836-29da-974c-b24fa92e1be7@aklaver.com
обсуждение исходный текст
Ответ на Delete a table automatic?  (黄宁 <huangning0722@gmail.com>)
Ответы Re: Delete a table automatic?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 10/31/22 18:44, 黄宁 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?


The only thing I can think of is a sql_drop event trigger:

https://www.postgresql.org/docs/current/functions-event-triggers.html#PG-EVENT-TRIGGER-SQL-DROP-FUNCTIONS

9.29.2. Processing Objects Dropped by a DDL Command

Though this will not be specific to one table.

-- 
Adrian Klaver
adrian.klaver@aklaver.com




В списке pgsql-general по дате отправления:

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Delete a table automatic?
Следующее
От: "MuraliPD@GMail"
Дата:
Сообщение: Re: Delete a table automatic?