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