Re: Rule problem: return value of insert

Поиск
Список
Период
Сортировка
От Stephen Friedrich
Тема Re: Rule problem: return value of insert
Дата
Msg-id 43CD4FC7.3000005@fortis-it.de
обсуждение исходный текст
Ответ на Re: Rule problem: return value of insert  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Rule problem: return value of insert  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thanks for the quick answer - even though it does not solve my problem  :-(

Tom Lane wrote:
 > Not when you're using a pile of conditional rules like that.  The last
 > one to fire determines the result, so you'll only see a nonzero count
 > when inserting into the last subtable.

Hm, it fails even if I have only a single inherited table.
Also only one rule will 'fire'. Or do you mean that the last rule that
gets evaluated will determine the result, even if it's where clause evaluates
to false?

 > I think you'd be better off to forget the rule approach and instead
 > put a trigger on the parent table that stores the values into the
 > appropriate subtable and then returns NULL.  Unfortunately that won't
 > fix the rowcount problem either (because suppressed inserts won't be
 > counted), but it will certainly outperform a large collection of rules.

Thanks I'll try that. Yet I have only some dozen cdrs at any time, so
I doubt it will make a big difference?


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Rule problem: return value of insert
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: Distance calculation