| |
| Functions |
| |
| In order to increase the productivity of database programmers, PostgreSQL has placed
often-used snippets of code into “functions” which can be called by the programmer. The most
often used of these functions are referred to as “aggregates” because they operate on a number
of rows simultaneously. These aggregates include Count( ), Sum( ), Max( ), Min(), and Avg( );
they are used to count the number of rows in a table, to find the sum of the numbers in a
column, and to find the maximum, minimum, and average values of a column, respectively. |
| |
| In addition to these aggregates, PostgreSQL also supports numerous other functions including
Mathematical, String Manipulation, Date/Time Conversion, Formatting, and Geometric functions. |
| |
| Even more flexibility is offered to the database programmer through PostgreSQL’s support
of User-Defined Functions. This capability allows a developer to encapsulate the code required
to perform user-specific tasks. Once incorporated into a function, these routines can be easily
called to perform work. |
| |