Re: Delete a table automatic?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Delete a table automatic?
Дата
Msg-id 1181453.1667316198@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Delete a table automatic?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> 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:

I wonder whether the OP's purposes wouldn't be better served by
making B a view or materialized view, instead of a separate table.
Then the cascaded-drop behavior would be automatic.

            regards, tom lane



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

Предыдущее
От: Ryan Ruenroeng
Дата:
Сообщение: Re: Autovacuum on Partitioned Tables
Следующее
От: Ron
Дата:
Сообщение: Re: Autovacuum on Partitioned Tables