Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPNaH-0002zC-Ev for pgsql-admin@arkaria.postgresql.org; Wed, 21 Nov 2018 08:10:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gPNaF-0008Di-FA for pgsql-admin@arkaria.postgresql.org; Wed, 21 Nov 2018 08:10:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPNaF-0008DY-4K for pgsql-admin@lists.postgresql.org; Wed, 21 Nov 2018 08:10:03 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gPNaB-0003PN-0X for pgsql-admin@postgresql.org; Wed, 21 Nov 2018 08:10:01 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 3AEA8105F3389 for ; Wed, 21 Nov 2018 01:09:57 -0700 (MST) Date: Wed, 21 Nov 2018 01:09:57 -0700 (MST) From: legrand legrand To: pgsql-admin@postgresql.org Message-ID: <1542787797239-0.post@n3.nabble.com> In-Reply-To: References: Subject: Re: Trigger to create automated range partition table MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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