Re: Change in rule behavior?
От | Tom Lane |
---|---|
Тема | Re: Change in rule behavior? |
Дата | |
Msg-id | 5691.1006730227@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Change in rule behavior? (Sergio Pili <sergiop@sinectis.com.ar>) |
Список | pgsql-hackers |
Sergio Pili <sergiop@sinectis.com.ar> writes: > psql:sql/rd_ri/bug_upd.sql:11: ERROR: Rules with WHERE conditions may > only have SELECT, INSERT, UPDATE, or DELETE actions > Why was changed? > Is it possible to maintain the previous behavior with my correction? Because it didn't work. Your patch might prevent a coredump, but it doesn't make the rule work correctly. See the comment on the error message: /* * We cannot support utility-statement actions (eg NOTIFY) * with nonempty rule WHEREconditions, because there's no way * to make the utility action execute conditionally. */ if (top_subqry->commandType == CMD_UTILITY && stmt->whereClause != NULL) elog(ERROR, "Ruleswith WHERE conditions may only have SELECT, INSERT, UPDATE, or DELETE actions"); What actually happened in your patched 7.1 was that the NOTIFY message was sent regardless of whether the WHERE condition was true or not. If you want that behavior, it's easy enough to get: put the NOTIFY in a separate rule that has no WHERE. regards, tom lane
В списке pgsql-hackers по дате отправления: