Re: Statement-level trigger results in recursion

2019-02-19 Thread Jitendra Loyal
Thanks for all your efforts. I appreciate it. Let us wait and see if someone can enlighten us, or you locate the conversation. Thanks once again Regards, Jiten On Tue 19 Feb, 2019, 3:19 AM Adrian Klaver, wrote: > On 2/18/19 9:07 AM, Jitendra Loyal wrote: > > I do understand that the statement

Re: Statement-level trigger results in recursion

2019-02-19 Thread Jitendra Loyal
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. Th

Re: Statement-level trigger results in recursion

2019-02-19 Thread Jitendra Loyal
My bad! It is a transition table. Consider the following revised definition of trigger: CREATE TRIGGER storage_locations_b_u_AS_DML AFTER UPDATE ON storage_locations REFERENCING NEW TABLE AS new_table OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION TRG_storage_locations_b_u_AS_DML ();

Re: Statement-level trigger results in recursion

2019-02-19 Thread Jitendra Loyal
Unfortunately no! Where can I see those? Will I don't my answer there; I have referred to the documentation and tried various things. Thanks and regards, Ken i On Mon 18 Feb, 2019, 9:59 PM Adrian Klaver, wrote: > On 2/18/19 8:23 AM, Jitendra Loyal wrote: > > My bad! > > > > It is a transition t

Re: Statement-level trigger results in recursion

2019-02-18 Thread Adrian Klaver
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 ta

Re: Statement-level trigger results in recursion

2019-02-18 Thread Adrian Klaver
On 2/18/19 8:38 AM, Jitendra Loyal wrote: Unfortunately no! Where can I see those? Will I don't my answer there; I have referred to the documentation and tried various things. Please do not top post. The style on this list is to use inline posting. https://www.postgresql.org/docs/10/sql-create

Re: Statement-level trigger results in recursion

2019-02-18 Thread Adrian Klaver
On 2/18/19 8:23 AM, Jitendra Loyal wrote: My bad! It is a transition table. Consider the following revised definition of trigger: CREATE TRIGGER storage_locations_b_u_AS_DML AFTER UPDATE ON storage_locations REFERENCING NEW TABLE AS new_table OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE

Re: Statement-level trigger results in recursion

2019-02-18 Thread Adrian Klaver
On 2/18/19 4:11 AM, Jitendra Loyal wrote: The AFTER Statement-level Trigger runs into infinite execution when another set of rows are affected for the same table through this trigger. Consider this use case where a table storage_locations that manages a hierarchy of storage_locations in store

Statement-level trigger results in recursion

2019-02-18 Thread Jitendra Loyal
The AFTER Statement-level Trigger runs into infinite execution when another set of rows are affected for the same table through this trigger. Consider this use case where a table storage_locations that manages a hierarchy of storage_locations in stores, and thus having following columns (for simpli