Re: Trigger to create automated range partition table - Mailing list pgsql-admin

From legrand legrand
Subject Re: Trigger to create automated range partition table
Date
Msg-id 1542787797239-0.post@n3.nabble.com
Whole thread Raw
In response to Re: Trigger to create automated range partition table  (Keith <keith@keithf4.com>)
List pgsql-admin
I confirm: This is not working now

for pg10 see

https://www.postgresql-archive.org/BUG-15437-Segfault-during-insert-into-declarative-partitioned-table-with-a-trigger-creating-partition-td6054925.html

this kind of trigger is even not supported in pg11
postgres=# CREATE TRIGGER check_pkey BEFORE INSERT ON tabpart
postgres-#      FOR EACH ROW EXECUTE PROCEDURE public.f_check_pkey();
ERROR:  "tabpart" is a partitioned table
DETAIL:  Partitioned tables cannot have BEFORE / FOR EACH ROW triggers.

There are many development works regarding this
see all threads about ATTACH/DETACH PARTITION CONCURRENTLY
for example

Today the only solution is to create those partitions before the first
INSERT statement ;o(

Regards
PAscal



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html


pgsql-admin by date:

Previous
From: Keith
Date:
Subject: Re: Trigger to create automated range partition table
Next
From: Shreeyansh Dba
Date:
Subject: Re: Oracle to Postgres-Licensed GUI tool