Book Image

PostgreSQL 11 Server Side Programming Quick Start Guide

By : Luca Ferrari
Book Image

PostgreSQL 11 Server Side Programming Quick Start Guide

By: Luca Ferrari

Overview of this book

PostgreSQL is a rock-solid, scalable, and safe enterprise-level relational database. With a broad range of features and stability, it is ever increasing in popularity.This book shows you how to take advantage of PostgreSQL 11 features for server-side programming. Server-side programming enables strong data encapsulation and coherence. The book begins with the importance of server-side programming and explains the risks of leaving all the checks outside the database. To build your capabilities further, you will learn how to write stored procedures, both functions and the new PostgreSQL 11 procedures, and create triggers to perform encapsulation and maintain data consistency. You will also learn how to produce extensions, the easiest way to package your programs for easy and solid deployment on different PostgreSQL installations.
Table of Contents (12 chapters)

Summary

Rules provide a powerful interface for interacting with the PostgreSQL query rewriting system. Thanks to rules, it is possible to transform a statement syntactically into another one or even into multiple ones. While this can also often be achieved by means of triggers, rules work at a syntactic level and are fired before any trigger. Of course, rules are not the universal solution to any problem and there are cases in which triggers are preferable and vice-versa. Knowing however how to handle statement rewriting is a valuable skill for any PostgreSQL server side developer.

In the next chapter, we will explain the PostgreSQL extension, which is a way to package your own code, including functions, procedures, triggers, tables, and so on, as well as manage its deployment and upgrade.