pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: Re: with and trigger
Date: Wed, 29 May 2019 06:10:23 -0700 (MST)
Message-ID: <1559135423282-0.post@n3.nabble.com> (raw)
In-Reply-To: <CAEzk6fdXusx=6PeUvOgDpeQE7ScDT8OAYtBXq8fsfUd8=9ZOvQ@mail.gmail.com>
References: <1559130758966-0.post@n3.nabble.com>
	<CAEzk6fdXusx=6PeUvOgDpeQE7ScDT8OAYtBXq8fsfUd8=9ZOvQ@mail.gmail.com>

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





view thread (8+ messages)  latest in thread

Message-ID: <1559135423282-0.post@n3.nabble.com>
Permalink:  ../1559135423282-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1559135423282-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: marcos@f10.com.br
  Subject: Re: with and trigger
  In-Reply-To: <1559135423282-0.post@n3.nabble.com>
  References: <1559130758966-0.post@n3.nabble.com> <CAEzk6fdXusx=6PeUvOgDpeQE7ScDT8OAYtBXq8fsfUd8=9ZOvQ@mail.gmail.com> <1559135423282-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox