Re: *****SPAM***** Re: if-clause to an exiting statement

Поиск
Список
Период
Сортировка
От Scott Ribe
Тема Re: *****SPAM***** Re: if-clause to an exiting statement
Дата
Msg-id 28AACBE0-0644-43B4-9D85-2DA118707ED8@elevated-dev.com
обсуждение исходный текст
Ответ на if-clause to an exiting statement  (Kobi Biton <kobi@comns.co.il>)
Ответы Re: *****SPAM***** Re: if-clause to an exiting statement  (Kobi Biton <kobi@comns.co.il>)
Список pgsql-general
On Dec 7, 2010, at 9:58 AM, Kobi Biton wrote:
>
> I know it does not sound logic however I do need to set the row count
> to 1 in case row count returns 0

Perhaps I didn't make myself clear: you can't do that. The only thing you can do is make sure your query returns a row,
andin the case where it currently doesn't return a row I have absolutely no idea what it would be that you would need
toreturn. 

If it would be acceptable to always return some hard-wired dummy row in addition to the 0 or more rows that match the
currentquery, then you could use a UNION to add the dummy row to the selection. Otherwise, perhaps the real problem is
thatyou do not have a matching event in the database and the real solution is to add such an event. 

In your original post you referred to an application bug where a trigger does not run if the row count is 0. It's hard
forme to imagine how it's a bug to not take action when there is no event that needs processing... 

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





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

Предыдущее
От: Steve Clark
Дата:
Сообщение: Re: dotted quad netmask conversion
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [ADMIN] restore In parallel postgres 9