pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Jitendra Loyal <jitendra.loyal@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Statement-level trigger results in recursion
Date: Mon, 18 Feb 2019 13:49:28 -0800
Message-ID: <22272c24-16ec-c7c4-e060-20f198792d26@aklaver.com> (raw)
In-Reply-To: <CAGBkusdRbvuJ+D1mP92HHS_nt6gCt6imaccArZ5ivQo1dT1NsQ@mail.gmail.com>
References: <CAGBkuscHvsPLEwUCLY0p9tfEg8UeDL4g8LvhhgDCMxJ71-Npsw@mail.gmail.com>
	<3459d021-67ca-4d38-1945-1fd576c0f826@aklaver.com>
	<CAGBkusew9s1CPUzy2wmjh9ULiSkq4qQZGmg1-1vzGjLK8U11Gg@mail.gmail.com>
	<a84978dd-f00c-db21-450f-ebf93b1cdee4@aklaver.com>
	<CAGBkusdxFDgyQLWmR+nf4r9n=_8aZ3kNnQmtEvDOrGSqeLGAqw@mail.gmail.com>
	<da854fc0-7742-1492-e722-2a08e8ee7ebf@aklaver.com>
	<CAGBkusdRbvuJ+D1mP92HHS_nt6gCt6imaccArZ5ivQo1dT1NsQ@mail.gmail.com>

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




view thread (9+ messages)  latest in thread

Message-ID: <22272c24-16ec-c7c4-e060-20f198792d26@aklaver.com>
Permalink:  ../22272c24-16ec-c7c4-e060-20f198792d26@aklaver.com/
Also on:    postgresql.org/message-id/22272c24-16ec-c7c4-e060-20f198792d26@aklaver.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: adrian.klaver@aklaver.com, jitendra.loyal@gmail.com
  Subject: Re: Statement-level trigger results in recursion
  In-Reply-To: <22272c24-16ec-c7c4-e060-20f198792d26@aklaver.com>
  References: <CAGBkuscHvsPLEwUCLY0p9tfEg8UeDL4g8LvhhgDCMxJ71-Npsw@mail.gmail.com> <3459d021-67ca-4d38-1945-1fd576c0f826@aklaver.com> <CAGBkusew9s1CPUzy2wmjh9ULiSkq4qQZGmg1-1vzGjLK8U11Gg@mail.gmail.com> <a84978dd-f00c-db21-450f-ebf93b1cdee4@aklaver.com> <CAGBkusdxFDgyQLWmR+nf4r9n=_8aZ3kNnQmtEvDOrGSqeLGAqw@mail.gmail.com> <da854fc0-7742-1492-e722-2a08e8ee7ebf@aklaver.com> <CAGBkusdRbvuJ+D1mP92HHS_nt6gCt6imaccArZ5ivQo1dT1NsQ@mail.gmail.com> <22272c24-16ec-c7c4-e060-20f198792d26@aklaver.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