Re: [HACKERS] about RULES

Поиск
Список
Период
Сортировка
От Jose' Soares
Тема Re: [HACKERS] about RULES
Дата
Msg-id 36A47AED.CC000243@sferacarta.com
обсуждение исходный текст
Ответ на Re: [HACKERS] about RULES  (jwieck@debis.com (Jan Wieck))
Список pgsql-hackers
> 
>     In  the case of a qualified instead rule, the parsetree get's
>     splitted.  One with the qual, one with the negated  qual.  If
>     you  only  want  'SALESMAN's,  you must put the qualification
>     into the INSERT action of the rule as
> 
>     create rule "_INSvista" as on insert to vista
>         do instead
>         insert into emp select new.empno, new.ename, new.job
>         where new.job='SALESMAN';

I see that rules is more complex than I thougth. 

I tried your example Jan but it doesn't work...

create rule "_INSvista" as on insert to vista     do instead     insert into emp select new.empno, new.ename, new.job
 where new.job='SALESMAN';
 
ERROR:  Type of empno does not match target column ename

-Jose'-


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

Предыдущее
От: José Paumard
Дата:
Сообщение: Error using home-made functions
Следующее
От: Matthias Schmitt
Дата:
Сообщение: different results selecting from base tables or views