Re: Database Insertion commitment

From: Ragnar <gnari(at)hive(dot)is>
To: Jasbinder Singh Bali <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Database Insertion commitment
Date: 2007-07-09 08:57:06
Message-ID: 1183971426.5778.58.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On mán, 2007-07-09 at 03:34 -0400, Jasbinder Singh Bali wrote:
> My scenario is something like this. I'll try to make it modular and
> simple.
>
> Start Function A (Written in plperlu with no subtransactions)
> Insert 1 on tbl_abc; (fires trigger A)
> Insert 2 on tbl_abc; (fires trigger A)
> End Function A
>
> Start Trigger A
> check the value of col_abc in tbl_abc
> Start Activity A if col_abc in tbl_abc doesn't is not
> duplicated.
> End Trigger A
>
> Now, if Insert 1 inserts col_abc = 'xyz' in tbl_abc
> and Insert 2 inserts the same value of col_abc ='xyz' the its not able
> to see the value of insert 1
> and erroneously starts Activity A that it should not actually.
>
> Do you think I am missing something vital here?
> I'm kind of stuck and confused because fundamentally Insert 2 should
> be able to see the value of Insert 1 as there is no subtransaction
> involved.

maybe you should provide us with a simple test case, to illustrate your
problem.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2007-07-09 09:05:09 Re: How to obtain a sequence's increment value from the system catalog
Previous Message Viatcheslav Kalinin 2007-07-09 08:53:38 Re: Database Insertion commitment