Re: [GENERAL] atomic function

2005-08-16 Thread Mage
Dennis Bjorklund wrote: On Mon, 15 Aug 2005, Mage wrote: 2005-08-12 19:08:43: ERROR: duplicate key violates unique constraint "common_adviewnum_adid_site_day_index" Between your select and your insert someone else inserted a row making the insert fail. I see. I thought that th

Re: [GENERAL] atomic function

2005-08-15 Thread Tino Wildenhain
Mage schrieb: Hello! What's wrong with this function? public | common_adviewnum_increase | integer | bigint, character varying | postgres | plpgsql | declare row record; result int; begin select into row viewnum from common_adviewnum where adid = $1 and s

Re: [GENERAL] atomic function

2005-08-15 Thread Dennis Bjorklund
On Mon, 15 Aug 2005, Mage wrote: > 2005-08-12 19:08:43: ERROR: duplicate key violates unique constraint > "common_adviewnum_adid_site_day_index" Between your select and your insert someone else inserted a row making the insert fail. See this example of how you can update or insert depending

[GENERAL] atomic function

2005-08-15 Thread Mage
Hello! What's wrong with this function? public | common_adviewnum_increase | integer | bigint, character varying | postgres | plpgsql | declare row record; result int; begin select into row viewnum from common_adviewnum where adid = $1 and site = $2 and da