Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-25 Thread Amit Kapila
On Wednesday, September 26, 2012 9:58 AM Alban Hertroys wrote: > > But some other databases like Oracle handles the scenario reported > but not > > loop. > > To handle for After triggers, there is mutation table concept in > Oracle due > > to which it errors out > > and for Before triggers, it erro

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-25 Thread Alban Hertroys
> But some other databases like Oracle handles the scenario reported but not > loop. > To handle for After triggers, there is mutation table concept in Oracle due > to which it errors out > and for Before triggers, it errors out with "maximum number of recursive SQL > levels(50) exceeded". Oracle

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-25 Thread Amit Kapila
On Monday, September 24, 2012 8:19 PM Tom Lane wrote: > Amit Kapila writes: > > Below test results into Loop: > > > [ AFTER INSERT trigger does another insert into its target table ] > > Well, of course. The INSERT results in scheduling another AFTER event. > > > I understand that user can c

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-24 Thread Amit Kapila
> On Monday, September 24, 2012 7:44 PM Adrian Klaver > On 09/24/2012 07:03 AM, Amit Kapila wrote: > > Below test results into Loop: > > > > 1.create test table > > > > CREATE TABLE TEST_TABLE (NAME VARCHAR2, AGE INT); > > > > 2.create trigger function > > > > CREATE OR REPLACE FUNCTION TRIG_FUNC (

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-24 Thread Adrian Klaver
On 09/24/2012 07:03 AM, Amit Kapila wrote: > Below test results into Loop: > > 1.create test table > > CREATE TABLE TEST_TABLE (NAME VARCHAR2, AGE INT); > > 2.create trigger function > > CREATE OR REPLACE FUNCTION TRIG_FUNC () RETURNS TRIGGER AS > > $$ > > DECLARE > > PSQL VARCHAR2; > > BEG

Re: [GENERAL] In one of negative test row-level trigger results into loop

2012-09-24 Thread Tom Lane
Amit Kapila writes: > Below test results into Loop: > [ AFTER INSERT trigger does another insert into its target table ] Well, of course. The INSERT results in scheduling another AFTER event. > I understand that user can change his code to make it proper. > However shouldn’t PostgreSQL