Re: RE: C function for use from PLpgSQL trigger
От | Joe Conway |
---|---|
Тема | Re: RE: C function for use from PLpgSQL trigger |
Дата | |
Msg-id | 00c301c08fa3$6edc0c90$c4d210ac@jecw2k1 обсуждение исходный текст |
Ответ на | RE: C function for use from PLpgSQL trigger (Michael Davis <mdavis@sevainc.com>) |
Список | pgsql-sql |
> You could send the column name directly into your c function. For example: > c_function_name(NEW.col1, NEW.col2, NEW.col3). Otherwise I am not sure how > to send NEW into a C function. You could try declaring NEW in your C > function as a tuple. Thanks for your reply. I was hoping that I could avoid hardcoding NEW.col1, etc, so that the function could be used for multiple relations. I've also tried to declare the input parameter to the function as a tuple, but PLpgSQL never gets that far -- it doesn't seem to support passing NEW as a parameter. Oh, well. I will probably just write all of my logic into a C function and skip PLpgSQL entirely. That's too bad because it would be far simpler (and preferrable IMHO) to write a generic trigger function in PLpgSQL and call C functions for only certain operations that PLpgSQL does not directly support. Joe
В списке pgsql-sql по дате отправления: