| От | Josh Berkus |
|---|---|
| Тема | Re: Why no INSTEAD OF triggers on tables? |
| Дата | |
| Msg-id | 52B08D14.8080100@agliodbs.com обсуждение исходный текст |
| Ответ на | Why no INSTEAD OF triggers on tables? (Josh Berkus <josh@agliodbs.com>) |
| Список | pgsql-hackers |
On 12/16/2013 07:53 PM, Robert Haas wrote: > So, put a BEFORE trigger, and make it return NULL. Same effect, > different notation. NOT the same: Master partition table with BEFORE trigger: josh=# insert into a ( id, val ) values ( 23, 'test' ), ( 24, 'test'), (25,'test'); INSERT 0 0 ^^^ View with INSTEAD OF trigger: josh=# insert into a_v ( id, val ) values ( 23, 'test' ), ( 24, 'test'), (25,'test'); INSERT 0 3 ^^^ The difference here is that the INSTEAD OF trigger returns a rows-affected count, and the BEFORE trigger does not (it returns 0). Some drivers and ORMs, most notably Hibernate, check this rows-returned count, and error if they don't match the rows sent. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера