[HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
Hi. This seem a bit strange to me. In short: 2 tables, one with has a foreign key to the other one; CREATE TABLE test (id SERIAL primary key, data text); CREATE TABLE testref(id SERIAL primary key, test_id integer references test(id) not null, data text); INSERT INTO test(data)

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
On 2011-04-11 20:18, Jesper Krogh wrote: Hi. This seem a bit strange to me. In short: Not any more I.. I guess what made me a bit confused was that a update table set key = value would acually block out changes on tables referencing this tuple even if the referenced column wasn't effected by

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Alvaro Herrera
Excerpts from Jesper Krogh's message of lun abr 11 17:07:33 -0300 2011: But when the locking is done row-level then it is correct to do it that way. It would allthough be nice with a weaker locklevel for that kind of updates (I have no clue if that is a hard problem).

Re: [HACKERS] Locking when concurrent updated of foreign references

2011-04-11 Thread Jesper Krogh
On 2011-04-11 23:30, Alvaro Herrera wrote: Excerpts from Jesper Krogh's message of lun abr 11 17:07:33 -0300 2011: But when the locking is done row-level then it is correct to do it that way. It would allthough be nice with a weaker locklevel for that kind of updates (I have no clue if that is