PostgreSQL Stored Procedures Tutorials and Examples
PostgreSQL allows you to extend its functionality with user defined functions by using various procedural languages such as PL/pgSQL, C, Perl, Python, and Tcl. These user defined functions are terms as Stored Procedures in PostgreSQL. Stored procedures allow you to create your custom functions and reuse them in applications or workflows in other databases.
A stored procedure is basically a set of precompiled SQL and procedural statements (declarations, assignments, loops, etc.) that is stored on the database server and can be invoked using the SQL interface to perform a special operation.
This article reviews the differences between stored procedures and functions in Postgres and the types of functionality they provide.
This article discusses the RAISE command for reporting errors, warnings, and other report messages within stored procedures and functions in PostgreSQL. Levels of error messages are covered along with settings for specifying their display to the clie ...
This article covers how stored procedures can make use of variables to be more functional and useful. After defining PL/pgSQL, stored procedures, and variables, it provides examples of how variables can be used.
This article covers how to create user-defined functions using PL/pgSQL procedural language in PostgreSQL. It introduces user-defined functions and gives examples of their use in different scenarios: PL/pgSQL; User-defined functions and procedures; C ...
A stored procedure is a set of structured queries and statements such as control statements and declarations. Here are ten examples of stored procedures that can be useful in different situations.
How to work with control structures in PostgreSQL stored procedures: Using IF, CASE, and LOOP statements
This article reviews control structures that can be used in PostgreSQL stored procedures, with syntax and examples provided for each.
This tutorial provides instructions and an example for calling a PostgreSQL stored procedure from a PHP application.