Search Postgresql Archives

cascade deleting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

I am wondering whether the following problem can 
be avoided by using Cascade Deleting while the DB 
is in Read Committed Isolation Level:

In the following scenario, The "DEL item1 from tb_pk" 
command fails because of  involating foreign key 
constraints.

(The tb_fk1, tb_fk2, and tb_fk3 tables reference the 
tb_pk table)
Transaction A		Transaction B
      begin()		                 |
           |                                                   |
DEL item1 from tb_fk1              begin()
          |                                                   |
DEL item1 from tb_fk2       INS item1 into tb_fk1
          |                                                  |
DEL item1 from tb_fk3           commit()
          |
DEL item1 from tb_pk
          |   
          |( failed because of involating foreign key constraint.)
          |
    commit()


My real question is:
Will Executing  "CASCADE DEL item1 from tb_pk" fail
if another transaction insert item1 into tb_fk1
during executing "CASCADE DEL item1 from tb_pk"?

Thanks
Duan


---------------------------------------------------
Duan Ligong
E-MAIL  : duanlg@xxxxxxxxxxxxxxxxx
Tel        : 010-82334433-354
            : 8-0086-22-354


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux