Functions and Procedures: Use and Misuse
Channel: Postgres Conference
Date: 2023-06-07

Functions are among the most underused and misused of PostgreSQL objects. Since all modern programming languages include user-defined functions, people often assume that database functions are cut from the same cloth and if you know how to write functions and when to write functions in an application programming language, you can apply this knowledge to PostgreSQL. This could not be further from the truth.

In this presentation, we will discuss how PostgreSQL functions are different from functions in other programming languages, when functions should be created and when they should not, how the usage of functions can improve performance, and how it can lead to major performance degradation.

The audience will learn:

How functions are executed
How usage of functions affects performance
How to use functions with user-defined types
Advantages and disadvantages of using functions in OPT and OLAP environments
How to use functions with dynamic SQL