Provided by: manpages-zh_1.5.2-1_all bug

NAME

       CREATE FUNCTION -

SYNOPSIS

       CREATE [ OR REPLACE ] FUNCTION name ( [ argtype [, ...] ] )
           RETURNS rettype
         { LANGUAGE langname
           | IMMUTABLE | STABLE | VOLATILE
           | CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
           | [EXTERNAL] SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER
           | AS 'definition'
           | AS 'obj_file', 'link_symbol'
         } ...
           [ WITH ( attribute [, ...] ) ]

DESCRIPTION

       CREATE FUNCTION  CREATE OR REPLACE FUNCTION

         CREATE OR REPLACE FUNCTION  CREATE OR REPLACE FUNCTION

          CREATE OR REPLACE FUNCTION

PARAMETERS

       name

       argtype

                tablename.columnname%TYPE

                ""  cstring SQL

       rettype
                 argtype

                ""  cstring SETOF

       langname
                 SQLC internal  createlang

       IMMUTABLE

       STABLE

       VOLATILE
                  VOLATILE

              IMMUTABLE

              STABLE   SQL    current_timestamp  stable ()

              VOLATILE    random()currval() timeofday()  setval()

       CALLED ON NULL INPUT

       RETURNS NULL ON NULL INPUT

       STRICT CALLED ON NULL INPUT

              RETURNS NULL ON NULL INPUT  STRICT  NULL NULL  NULL   NULL

       [EXTERNAL] SECURITY INVOKER

       [EXTERNAL] SECURITY DEFINER
              SECURITY INVOKER  SECURITY DEFINER

                EXTERNAL  SQL   SQL

       definition
                 SQL

       obj_file, link_symbol
                AS  C  SQL  C   obj_file  link_symbol  C   SQL

       attribute

              isStrict
                       STRICT  RETURNS NULL ON NULL INPUT

              isCachable
                     isCachable  IMMUTABLE

NOTES

         ``User-Defined Functions''

         SQL  numeric   CREATE FUNCTION

       PostgreSQL    C   C  C  C

         CREATE FUNCTION  LOAD [load(7)]

         DROP FUNCTION

         USAGE

EXAMPLES

          ``User-Defined Functions''

       CREATE FUNCTION add(integer, integer) RETURNS integer
           AS 'select $1 + $2;'
           LANGUAGE SQL
           IMMUTABLE
           RETURNS NULL ON NULL INPUT;

COMPATIBILITY

         SQL99 CREATE FUNCTION  PostgreSQL

SEE ALSO

       ALTER  FUNCTION  [alter_function(7)], DROP FUNCTION [drop_function(7)],
       GRANT [grant(7)], LOAD [load(7)], REVOKE [revoke(7)], createlang(1)

       Postgresql  <laser@pgsqldb.org>