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 1hVyMe-0003jI-1P for pgsql-general@arkaria.postgresql.org; Wed, 29 May 2019 13:11:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hVyLc-0006sF-D7 for pgsql-general@arkaria.postgresql.org; Wed, 29 May 2019 13:10:28 +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 1hVyLb-0006pr-VW for pgsql-general@lists.postgresql.org; Wed, 29 May 2019 13:10:28 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hVyLY-0008MH-Qm for pgsql-general@postgresql.org; Wed, 29 May 2019 13:10:26 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 455C914617D5E for ; Wed, 29 May 2019 06:10:23 -0700 (MST) Date: Wed, 29 May 2019 06:10:23 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1559135423282-0.post@n3.nabble.com> In-Reply-To: References: <1559130758966-0.post@n3.nabble.com> Subject: Re: with and trigger 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 Well, I think is not a transaction problem, because if you do the same thing on a DO it will work. DO $$ declare vMaster_ID integer; begin insert into Master(Customer_ID, Field2) values(1, 'BlaBla') returning Master_ID into vMaster_ID; insert into Detail(Master_ID, Product_ID, ProductValue) values(vMaster_ID, 5, 50); end $$ As you can see, works exactly the same way and Detail trigger works as expected, why ? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html