Chapter 7. Server-Side Programming with PL/pgSQL
The ability to write functions in PostgreSQL is an amazing feature. One can perform any task within the scope of the database server. These tasks might be related directly to data manipulation such as data aggregation and auditing, or can be used to perform miscellaneous services such as statistics collection, monitoring, system information acquisition, and job scheduling.
In this chapter, our focus is the PL/pgSQL language. PL/pgSQL can be considered as the default PostgreSQL, which is a full-fledged procedural language. As mentioned earlier in Chapter 4, PostgreSQL Advanced Building Blocks, PL/pgSQL is installed by default in PostgreSQL.