| От | Sven W |
|---|---|
| Тема | pl/pgsql FOUND variables and RULES |
| Дата | |
| Msg-id | 4A24564B.90808@dmv.com обсуждение исходный текст |
| Ответы |
Re: pl/pgsql FOUND variables and RULES
|
| Список | pgsql-general |
I have a volatile function (trigger) that gathers NEW.*, parses them, then inserts a subset of values into a different table. The table is set up as an inherited table where the parent table has a RULE : CREATE RULE myrule AS ON INSERT TO mytable WHERE ( myfield >= 100 and myfield < 200) DO INSTEAD INSERT INTO mytable_100 (field1,field2,field3,myfield) VALUES (NEW.field1,NEW.field2, NEW.field3, NEW.myfield); Now when the trigger fires the insert does happen and ends up in mytable_100 but the FOUND variable is not set (since technically 0 rows got inserted into mytable). Is there a proper way to set up rules such that the FOUND variable is set within pl/pgsql upon a successful insert (via the rule) or how can I check for a successful insert? Sven
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера