Chapter 8. Using Unrestricted Languages
You may have noticed, that some of the PLs in PostgreSQL can be declared as untrusted. They all end in the letter u
to remind you that they are untrusted each time you use them to create a function. Unrestricted languages allow you to do things that restricted or trusted languages are not allowed to do; for example, interacting with the environment and creating files and opening sockets. In this chapter, we will look at some examples in detail.
This untrustedness brings up many questions:
- Does being untrusted mean that such languages are somehow inferior to trusted ones?
- Can I still write an important function in an untrusted language?
- Will they silently eat my data and corrupt the database?
The answers are no, yes, and maybe respectively. Let's now discuss these questions in order.