PostgreSQL has a lot of built-in functions, such as Trigonometric Functions, String Functions, IP address functions, etc. But we’re not limited by built-in functions. PostgreSQL (as well as other RDBMS) allows creating custom functions. In this tutorial we will take a look at user-defined functions.
PostgreSQL supports the following programming languages for writing functions:
SQL PL/pgSQL C PL/Python PL/Tcl some other languages Create functions with PL/pgSQL Functions written in PL/pgSQL can contain a variable declaration, conditional and looping constructions, exception handling and so on.
Continue reading