Strange update behaviour

Поиск
Список
Период
Сортировка
От ProfiVPS Support
Тема Strange update behaviour
Дата
Msg-id 257ece670da80be9e2d08126aba9c641@profivps.hu
обсуждение исходный текст
Ответы Re: Strange update behaviour
Список pgsql-sql

Hi Gentz, 

  I'm in a dire need of help, because this bug is killing me for weeks now. 

  I got a function, and that function has a simple update query in it: 

UPDATE app_devices SET device_state = p_values[1], device_updateTs = NOW(),
device_changets = CASE WHEN device_state <> p_values[1] THEN NOW() ELSE device_changets END,
device_alertstate = CASE WHEN device_state <> p_values[1] THEN 0 ELSE device_alertstate END
WHERE device_id=dev_id;


 The device_alertstate's default value is 200. update and changets are null by default. 

 And I constantly face a result when the device_state is updated, changets and updatets are populated, but the device_alertstate remains on the default 200. 

  As far as I can tell from the second round and forward it works well. 

  I am simply not able to come up with any reasons for this to happen. 


Thank you very much in advance!

Bests, 

András

---
Olcsó Virtuális szerver:
http://www.ProfiVPS.hu

Támogatás: Support@ProfiVPS.hu

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Wetmore, Matthew (CTR)"
Дата:
Сообщение: PostgreSQL Objects design
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Strange update behaviour