Online Documentation for SQL Manager for PostgreSQL

Functions


A Function is a mapping embodied as a program (the function body) that can be invoked by using zero or more input values (arguments) to a single value (the result). A Function can be stored as a database object providing reusable code.

 

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 base types, composite types, or combinations of these as arguments (parameters). In addition, every kind of function can return a base type or a composite type. Many kinds of functions can take or return certain pseudo-types (such as polymorphic types), but the available facilities vary.

 

Function Editor allows you to define function properties. It opens automatically when you create a new function and is available on editing an existing one.