Insert Rule
От | Curtis Scheer |
---|---|
Тема | Insert Rule |
Дата | |
Msg-id | 031936836C46D611BB1B00508BE7345D04A589E6@gatekeeper.daycos.com обсуждение исходный текст |
Ответы |
Re: Insert Rule
Re: Insert Rule |
Список | pgsql-general |
I’m trying to prevent any further input of a particular field value via an insert rule with the following rule.
CREATE OR REPLACE RULE rule_foovalue AS
ON INSERT TO foo
WHERE new.foovalue = 1 DO SELECT fooexception.fooexception
FROM fooexception() fooexception(fooexception);
Basically the stored procedure that it calls raises an exception. The behavior I wanted\excepted was to call the stored procedure when foovalue = 1 and to execute a regular insert when foovalue <> 1. What its doing is calling the stored procedure when foovalue = 1, that part works just fine. However, when I try to insert a record into foo with any other value besides 1 it actually inserts the record but doesn’t return the # of rows affected. Is there something else I need to add to the rule so that it returns the number of rows affected like normal?
Thanks,
Curtis
В списке pgsql-general по дате отправления: