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 1gvqnF-0005Eq-AQ for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 21:49:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvqnE-0004Co-1j for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 21:49:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvqnC-0004Ar-7Q for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 21:49:39 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvqn6-0003B8-L4 for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 21:49:37 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7FA6A22460; Mon, 18 Feb 2019 16:49:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 18 Feb 2019 16:49:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=c cHKlkOwbSY016rLxAwDX+K+TjKqbp8L7l3NBLU3/h0=; b=B2a5lb7PuCMvu/h4p 4fESWFOj0flYkhdu7xHhsoYQgdF7oqK/NHipRo4EFPuIuuWeeDCGzyEsoN0uP3Un eS/fIfC3NV3UwEvsn+f34ydkC7sn6I+nQd79/x8rEijl0wYSC+JN2WdQtt2iw52w Z3LxbWTKoASeQS4QRBkdHKLp0+WcCl4kYo9acUwlATmct3b02b3LeAaeZh+OGh/m ViwdiUuuDI6fZlxBQQrBHvnWrfy+XzNWQwZLJeFRDmk3+u+0xFUUTvNdnEWYF/GD oizBHHMmxFQqZs9lAzEFUkmeaSJgwEaqolqPw1iJJZ2VKX5ryZM7x1otQN70jCH+ gpzVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=ccHKlkOwbSY016rLxAwDX+K+TjKqbp8L7l3NBLU3/ h0=; b=IBXAsAMbvQD1ADPSSpNoqzWX68/JtaGn/hhZWZ2+dEjIEYDF9lx9bkswe wjHZ7V61raJ/ZiRvGREYhq5qYqQ8zQFOR9wbiEa/gqhCwGV0RsnFuk3mU7sVvaqw JtwM1Zz+gJwt6p/s8x2R4vhvB7HHiEKGj/k7x+mgo3oPU5ywODPRYFczvsRhOBRX 8jESBgA7sjmjbITqiQfRyddrnBu/g83SfogS9AK84E4GTGsJUWIP0YGEk76xqtcw LZ5/dUz/QXyqlo1/oCK20Qp5LCeGuD1tNV3jdxFK7QPIYZEloc0bIYlLb1/Tez8o IKnXdPGBZnffASJld+Mg6J2bb88HQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtddugdduvdefucdltddurdegtdelrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhf rhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 9617910316; Mon, 18 Feb 2019 16:49:29 -0500 (EST) Subject: Re: Statement-level trigger results in recursion To: Jitendra Loyal Cc: pgsql-general@lists.postgresql.org References: <3459d021-67ca-4d38-1945-1fd576c0f826@aklaver.com> From: Adrian Klaver Message-ID: <22272c24-16ec-c7c4-e060-20f198792d26@aklaver.com> Date: Mon, 18 Feb 2019 13:49:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/18/19 9:07 AM, Jitendra Loyal wrote: > I do understand that the statement level trigger will be executed once > before the operation. My point is.. if one does not know the rows, what > kind of use it can be put to. What is the use case? Like in after > triggers, one gets the rows in transition tables, how does one do with > vefore trigger. Use FOR EACH ROW. Why you cannot use a FOR EACH STATEMENT trigger is something I thought I remember being discussed on the list before. Unfortunately I cannot find that conversation at the moment. Someone else will need to weigh in on this. > > Thanks and regards, > Jiten -- Adrian Klaver adrian.klaver@aklaver.com