Similar question has been asked many times on mailing lists and on IRC. Sometimes it's not mail sending, but file/directory creation, or something else that generally requires some interaction with "world outside of database". Can it be done? Sure. How, then?

Some time ago, I was listening to This week in tech and I heard Leo Laporte raving about book Daemon by Daniel Suarez. Did some research, got the book, read it. Relatively soon I heard that there is second part ...