Drop Trigger Mechanism with Detached partitions
От | M Beena Emerson |
---|---|
Тема | Drop Trigger Mechanism with Detached partitions |
Дата | |
Msg-id | CANPX-3XaZWchcjBbd2sAdCU4oR2kJ28S6Q-oWE08ZbPZH1Apbg@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Drop Trigger Mechanism with Detached partitions
|
Список | pgsql-hackers |
Detach partition does not remove the partition trigger dependency as seen in below scenario.
rm44010_p had 2 partition p1 and p2 and p2 was detached.
A. Description of a partitioned table
\d+ rm44010_pPartitioned table "public.rm44010_p"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
c1 | integer | | | | plain | |
c2 | integer | | | | plain | |
Partition key: RANGE (c2)
Triggers:
rm44010_trig1 AFTER INSERT ON rm44010_p FOR EACH ROW EXECUTE FUNCTION trig_func()
Partitions: rm44010_p1 FOR VALUES FROM (1) TO (100)
B. Description of the detached partition still shows the trigger.
\d+ rm44010_p2
Table "public.rm44010_p2"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
c1 | integer | | | | plain | |
c2 | integer | | | | plain | |
Triggers:
rm44010_trig1 AFTER INSERT ON rm44010_p2 FOR EACH ROW EXECUTE FUNCTION trig_func()
Access method: heap
C. Drop Trigger on partitioned table also removes the trigger on the detached partition.
DROP TRIGGER RM44010_trig1 ON RM44010_p;
DROP TRIGGER
\d+ rm44010_p2
Table "public.rm44010_p2"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
c1 | integer | | | | plain | |
c2 | integer | | | | plain | |
Access method: heap
В списке pgsql-hackers по дате отправления: