Book Image

PostgreSQL Server Programming

Book Image

PostgreSQL Server Programming

Overview of this book

Table of Contents (21 chapters)
PostgreSQL Server Programming Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Can you use untrusted languages for important functions?


Absolutely! Sometimes, it may be the only way to accomplish some tasks from inside the server. Performing simple queries and computations should do nothing harmful to your database, and neither should connecting to the external world for sending e-mails, fetching web pages, or performing SOAP requests. However, be careful about performing operations that may cause delays and even queries that get stuck, but these can usually be dealt with by setting an upper limit as to how long a query can run, by using an appropriate statement time-out value. Setting a reasonable statement time-out value by default is a good practice anyway.

So, if you don't deliberately do risky things, the probability of harming the database is no bigger than using a "trusted" (also known as restricted) variant of the language. However, if you give the language to someone who starts changing bytes on the production database "to see what happens", you will get what...