Re: SQL Rule

Поиск
Список
Период
Сортировка
От Bert
Тема Re: SQL Rule
Дата
Msg-id 1146088159.793976.234800@y43g2000cwc.googlegroups.com
обсуждение исходный текст
Ответ на Re: SQL Rule  ("Bert" <clemens.bertschler@gmail.com>)
Ответы Re: SQL Rule  (Kenneth Downs <ken@secdat.com>)
Список pgsql-general
Okay sorry i have to change the trigger from AFTER TO BEFORE
CREATE TRIGGER trigger_sum
        BEFORE INSERT OR UPDATE
        ON test
        FOR EACH ROW
        EXECUTE PROCEDURE trigger_test();

TO ALBAN
Our table definition are the same, so what? A primary key is a
constraint.
And
>> CREATE OR REPLACE RULE sum_op AS
>>     ON INSERT TO test DO  UPDATE test SET c = new.a + new.b
>>   WHERE test.id = new.id;

>How do you expect to update a record that doesn't exist yet?
This rule is creating first of all the insert and then i can run an
Update on this insert, so far its functioning. Your definition is quite
good but what are doing when you change the table definition? Rewrite
all Rules?
But nevertheless thank you.
Best regards,
Bert


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

Предыдущее
От: Alan Hodgson
Дата:
Сообщение: Re: SQL Rule
Следующее
От: Holger Zwingmann
Дата:
Сообщение: problem with unique text column