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)

Inter Process Communication and Background Workers

This chapter focuses on processes. PostgreSQL uses processes to carry out all its magic. Database connections are handled by backend processes, while utility processes (such as vacuum, autovacuum, or WAL writer) run all the time to ensure that a database is in good shape.

From the user's perspective, the process-model provides strong isolation. This means that, apart from the database data being used as a communication stream, two processes cannot easily inter-communicate. For this reason, PostgreSQL provides a powerful and elegant model of event broadcasting that allows backend processes and client processes to synchronize and exchange data dynamically.

However, process communication is not the only feature shown in this chapter. PostgreSQL also allows the user to write custom processes, called background workers, that can...