When you start tackling complex high-volume data problems, SQL might not be enough. When your logic needs to be close to your data, PostgreSQL has a secret weapon, PL/pgSQL. An imperative language that extends SQL, PL/pgSQL lets you execute complex read and write logic directly on the database. The benefits include increased speed and concurrency, code reuse among many applications, strong consistency guarantees, and greater query flexibility.
This presentation will show you how PL/pgSQL functions can speed up your indexes, accelerate complex queries, activate custom triggers on data changes, and handle complex write situations. Afterwards, you will be able to take control of your data directly at the source, within PostgreSQL itself.
Key points discussed:
* PL/pgSQL: what it is and why it matters
* Volatility: living in an uncertain data world
* Upserts: a little update with a little insert
* Triggers: keeping data consistent
* Code Blocks: control when you need it
SQL examples given during the presentation are available here: http://www.reactive.io/academy/presentations/postgresql/plpgsql/plpgsql-examples.zip