Re: [HACKERS] INSERT ... SELECT ... FOR SHARED?

2008-04-21 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: The lack of regression tests covering this area is a bit annoying at this point. However, it's hard to see how to test FOR UPDATE until we get some concurrent-sessions support in psql. Well, end-to-end testing would e better but we can test that the locks

Re: [HACKERS] INSERT ... SELECT ... FOR SHARED?

2008-04-21 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: The lack of regression tests covering this area is a bit annoying at this point. However, it's hard to see how to test FOR UPDATE until we get some concurrent-sessions support in psql. Well, end-to-end testing would

[HACKERS] INSERT ... SELECT ... FOR SHARED?

2008-04-20 Thread Mark Mielke
This is similar to a previous question I had asked about INSERT ... DELETE ... To be safe, to archive an existing row, and replace with a new row, I believe on must do: begin; row := select ... from XXX where ... for update; insert into XXX_archived values (row); ... update or

Re: [HACKERS] INSERT ... SELECT ... FOR SHARED?

2008-04-20 Thread Tom Lane
Mark Mielke [EMAIL PROTECTED] writes: # insert into product_image_archived select * from product_image where itemno = 'XX' for update; ERROR: cannot extract system attribute from virtual tuple Hm, on an assert-enabled build this actually crashes :-(. It looks like I broke the specific