Drop Trigger Mechanism with Detached partitions

From: M Beena Emerson <mbeena(dot)emerson(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Drop Trigger Mechanism with Detached partitions
Date: 2019-09-30 09:58:53
Message-ID: CANPX-3XaZWchcjBbd2sAdCU4oR2kJ28S6Q-oWE08ZbPZH1Apbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rushabh Lathia 2019-09-30 10:07:09 Re: backup manifests
Previous Message Pengzhou Tang 2019-09-30 09:41:23 Re: Parallel grouping sets