| От | Tom Lane |
|---|---|
| Тема | Re: Pl/Pgsql triger procedure calls with parameters |
| Дата | |
| Msg-id | 16117.1006818599@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Pl/Pgsql triger procedure calls with parameters (David A Dickson <davidd@saraswati.wcg.mcgill.ca>) |
| Список | pgsql-general |
David A Dickson <davidd@saraswati.wcg.mcgill.ca> writes:
> I am trying to make a call to a function that takes three text parameters
> as input from a trigger. The function is supposed to check if
> SELECT * FROM $3 WHERE new.$1 = $3.$2
> has more than 0 rows.
While this may seem neat and clean, I think you'd be a lot better off
writing multiple trigger functions that have the table and field names
wired into them. If you insist on parameterizing like this, you will
have to run the queries via EXECUTE in plpgsql, which means you will get
no query plan caching, which is a performance hit you probably do not
want to take in a trigger function.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера