| От | Alex Guryanow |
|---|---|
| Тема | SPI_modifytuple for varchar |
| Дата | |
| Msg-id | 437.000919@nlr.ru обсуждение исходный текст |
| Список | pgsql-general |
Hi, my query is about using the function SPI_modifytuple for a varchar field. I have (for example) a table with a field my_field of type varchar(100). And I need to create a trigger that adds the phrase "hello, world" to any value, that user inserts (or updates) in field my_field. Using SPI_getvalue I can retrive the value that user tries to insert, I can concatenate this value with my phrase "hello world" using standard function strcat, but I do not understand what arguments should I pass to SPI_modifytuple function. Say my_value is the pointer to the concatenated string: char *my_value; If I use the function SPI_modifytuple( rel, newtuple, 1, attnums, my_value, NULL ) then my backend crashes. Can anybody say what I'm doing wrong or give me an example of modification of varchar value using SPI_* interface? Best regards, Alex
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера