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.92) (envelope-from ) id 1jEynq-0002LP-Gd for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Mar 2020 17:17:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEynp-0000Cd-8b for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Mar 2020 17:17:53 +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 1jEyIA-00043b-Bi for pgsql-bugs@lists.postgresql.org; Thu, 19 Mar 2020 16:45:10 +0000 Received: from gate.auconet-it.com ([195.243.9.3]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEyI6-0006Zb-Pe for pgsql-bugs@lists.postgresql.org; Thu, 19 Mar 2020 16:45:09 +0000 Received: from gate.auconet-it.com (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id E7B2D57AE6_E73A18EB for ; Thu, 19 Mar 2020 16:45:02 +0000 (GMT) Received: from mail.auconet-it.com (mail.auconet.com [10.10.11.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailcow.auconet.com", Issuer "Auconet Sub Alpha" (not verified)) by gate.auconet-it.com (Sophos Email Appliance) with ESMTPS id 28C6C5508F_E73A18DF for ; Thu, 19 Mar 2020 16:45:00 +0000 (GMT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D77F335E90; Thu, 19 Mar 2020 17:44:59 +0100 (CET) From: "Raschkowski, Michael" To: Cc: "Hartmut Bolten" , "Hannes Just" Subject: Trigger does not work after partitioning Date: Thu, 19 Mar 2020 17:44:59 +0100 Message-ID: <001c01d5fe0d$baddddb0$30999910$@auconet-it.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001D_01D5FE16.1CA2E1F0" Thread-Index: AdX+CqhDL8eSD0H8Se+dzEJKzA/c9g== Content-Language: de X-Last-TLS-Session-Version: TLSv1.2 X-SASI-RCODE: 200 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_001D_01D5FE16.1CA2E1F0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_001E_01D5FE16.1CA2E1F0" ------=_NextPart_001_001E_01D5FE16.1CA2E1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 I am using Postgres 12.1 on Windows 10. =20 I wrote the script for the partitioning of some tables and have noticed = that some triggers do not work after partitioning. In attached example, you = can see that the table test1 gets a trigger that sets the field instancenbr = to 1 after each insertion. Nevertheless, the field instancenbr stays to have NULL-Value. =20 Is it a bug or I have not taken something into account? =20 Thanks in advance! =20 =20 Viele Gr=FC=DFe / Kind regards, Dr. Michael Raschkowski=20 Software Architect Auconet GmbH - ein Unternehmen der Beta Systems Gruppe An den Treptowers 1, 12435 Berlin Phone: +49 30 254 690-356 Fax: +49 30 254 690-199 Email: michael.raschkowski@auconet-it.com www.auconet-it.com Mandatory Information for business emails according to German trade laws = / Pflichtangaben f=FCr gesch=E4ftliche E-mails gem=E4=DF = Handelsgesetzbuch: Auconet GmbH - ein Unternehmen der Beta Systems Gruppe An den Treptowers 1 12435 Berlin Germany Phone: +49-(0)30-254 690-0 Fax: +49-(0))30-254 690-199 info@auconet-it.com www.auconet-it.com Management / Gesch=E4ftsf=FChrer: Hartmut Bolten, Sebastian Zang Legal form / Rechtsform: GmbH | Registered office / Sitz: Berlin Commercial register / Handelsregister: Amtsgericht Charlottenburg HRB = 141 887 B VAT-ID / Ust-ID-Nr.: DE316422231 | Tax No. / St.-Nr.: 30/036/75431 Bank / Bankverbindung: Commerzbank AG, BIC: COBADEFF, IBAN: DE25 1004 = 0000 0230 9391 00 =20 =20 ------=_NextPart_001_001E_01D5FE16.1CA2E1F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello,

 

I am using Postgres 12.1 on Windows = 10.

 

I wrote the script for the partitioning of some tables and = have noticed that some triggers do not work after partitioning. In = attached example, you can see that the table test1 gets a trigger that = sets the field instancenbr to 1 after each insertion. =A0Nevertheless, = the field instancenbr stays to have NULL-Value.

 

Is it a bug or I have not taken = something into account?

 

Thanks in advance! =A0

 

Viele Gr=FC=DFe / Kind = regards,

Dr. Michael Raschkowski
Software = Architect

Auconet GmbH - ein Unternehmen der Beta Systems = Gruppe
An den Treptowers 1, 12435 = Berlin
Phone: +49 30 254 690-356
Fax: +49 30 254 = 690-199

Email: michael.raschkowski@auconet-it.com=
www.auconet-it.com

Mandatory Information for = business emails according to German trade laws / Pflichtangaben f=FCr = gesch=E4ftliche E-mails gem=E4=DF Handelsgesetzbuch:

Auconet GmbH = - ein Unternehmen der Beta Systems Gruppe
An den Treptowers = 1
12435 Berlin
Germany
Phone: +49-(0)30-254 690-0
Fax: = +49-(0))30-254 690-199
info@auconet-it.com
www.auconet-it.com

Management / = Gesch=E4ftsf=FChrer: Hartmut Bolten, Sebastian Zang
Legal form / = Rechtsform: GmbH | Registered office / Sitz: Berlin
Commercial = register / Handelsregister: Amtsgericht Charlottenburg HRB 141 887 = B
VAT-ID / Ust-ID-Nr.: DE316422231 | Tax No. / St.-Nr.: = 30/036/75431
Bank / Bankverbindung: Commerzbank AG, BIC: COBADEFF, = IBAN: DE25 1004 0000 0230 9391 00

 

 

------=_NextPart_001_001E_01D5FE16.1CA2E1F0-- ------=_NextPart_000_001D_01D5FE16.1CA2E1F0 Content-Type: application/octet-stream; name="error_part_trigger.sql" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="error_part_trigger.sql" drop table if exists test1; CREATE TABLE public.test1 ( object_id bigint primary key NOT NULL, permission_label text, instancenbr smallint ) PARTITION BY RANGE (object_id); CREATE TABLE public.test1_1 PARTITION OF public.test1 FOR VALUES FROM (0) TO (72620543991349248); CREATE OR REPLACE FUNCTION public.insert_test1() RETURNS trigger LANGUAGE 'plpgsql' AS $BODY$ BEGIN = =20 IF TG_OP =3D 'INSERT' THEN =20 NEW.instancenbr =3D 1; RAISE NOTICE '%', NEW.instancenbr; END IF; RETURN NEW; END; $BODY$; DROP TRIGGER IF EXISTS insert_object_trigger_instance ON public.test1; CREATE TRIGGER insert_object_trigger_instance AFTER INSERT ON public.test1 FOR EACH ROW EXECUTE PROCEDURE public.insert_test1(); insert into test1(object_id) values (1); select * from test1; ------=_NextPart_000_001D_01D5FE16.1CA2E1F0--