Drop Trigger Mechanism with Detached partitions - Mailing list pgsql-hackers

From M Beena Emerson
Subject Drop Trigger Mechanism with Detached partitions
Date
Msg-id CANPX-3XaZWchcjBbd2sAdCU4oR2kJ28S6Q-oWE08ZbPZH1Apbg@mail.gmail.com
Whole thread Raw
Responses Re: Drop Trigger Mechanism with Detached partitions
List 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_p
                           Partitioned 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



--
Beena Emerson

EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-hackers by date:

Previous
From: Pengzhou Tang
Date:
Subject: Re: Parallel grouping sets
Next
From: Rushabh Lathia
Date:
Subject: Re: backup manifests