Extending SQL: Functions

Chapter 9. Extending SQL: Functions

9.1. Introduction

PostgreSQL provides four kinds of functions:

  • query language functions (functions written in SQL)

  • procedural language functions (functions written in, for example, PL/Tcl or PL/pgSQL)

  • internal functions

  • C language functions

Every kind of function can take a base type, a composite type, or some combination as arguments (parameters). In addition, every kind of function can return a base type or a composite type. It's easiest to define SQL functions, so we'll start with those. Examples in this section can also be found in funcs.sql and funcs.c in the tutorial directory.

Throughout this chapter, it can be useful to look at the reference page of the CREATE FUNCTION command to understand the examples better.

Home
Online Resources
General
Beginner Tutorials
MySQL
PostgreSQL
Oracle
mSQL
Microsoft SQL
Contact Us
Random quote of the moment:
Meekness: Uncommon patience in planning a revenge that is worth while. -- Ambrose Bierce
 
http://www.sql.org/
 
Proudly designed and hosted by OmegaSphere, providers of all your Web Hosting, SSL Certificate, and Domain Name needs!