| От | Tom Lane |
|---|---|
| Тема | Re: modifying new tuple on insert in c trigger |
| Дата | |
| Msg-id | 13793.1038369478@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | modifying new tuple on insert in c trigger ("Damjan Pipan" <damjan.pipan@xlab.si>) |
| Список | pgsql-general |
"Damjan Pipan" <damjan.pipan@xlab.si> writes:
> I'm trying to write a c trigger function which would change an
> attribute of tuple being inserted. I have read this value
> from some other table and now I have a problem, because
> even if I change the tuple with SPI_modifytuple and return
> modified tuple it does not show in db (it did not change the tuple)
> but tuple is inserted.
Before groveling through the C code ... did you declare the trigger
as BEFORE or AFTER? Only BEFORE triggers get to change the inserted
tuple.
Also, I think the "r" array needs to contain 'r' not ' ' at the
positions where you want to replace columns.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера