| От | Tom Lane |
|---|---|
| Тема | Re: how to make a trigger to copy files. |
| Дата | |
| Msg-id | 5464.1106507109@sss.pgh.pa.us обсуждение |
| Ответ на | how to make a trigger to copy files. (Mitchell Laks <mlaks@verizon.net>) |
| Список | pgsql-admin |
Mitchell Laks <mlaks@verizon.net> writes:
> I would like my server to immediately "scp" the file to another machine, as
> soon as the application updates the table with the new entry.
> But when i look for sample triggers on the web they seem to only do things
> internal to the database (change field entries etc, check them for business
> logic rules etc).
That's generally a good design rule, for the simple reason that a
trigger can never know whether the transaction will roll back after
it executes. If you change state outside the database then that state
may become inconsistent with the database. However, if you can restrict
your operations to cases where that won't hurt much, you may be able to
get away with it.
regards, tom lane
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера