diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2017-11-30 08:46:13 -0500 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2017-11-30 11:03:20 -0500 |
| commit | e4128ee767df3c8c715eb08f8977647ae49dfb59 (patch) | |
| tree | 6513b824fd69b982057f5fe2742039597ce6cea4 /doc/src/sgml/ref/create_function.sgml | |
| parent | 1761653bbb17447906c812c347b3fe284ce699cf (diff) | |
| download | postgresql-e4128ee767df3c8c715eb08f8977647ae49dfb59.tar.gz | |
SQL procedures
This adds a new object type "procedure" that is similar to a function
but does not have a return type and is invoked by the new CALL statement
instead of SELECT or similar. This implementation is aligned with the
SQL standard and compatible with or similar to other SQL implementations.
This commit adds new commands CALL, CREATE/ALTER/DROP PROCEDURE, as well
as ALTER/DROP ROUTINE that can refer to either a function or a
procedure (or an aggregate function, as an extension to SQL). There is
also support for procedures in various utility commands such as COMMENT
and GRANT, as well as support in pg_dump and psql. Support for defining
procedures is available in all the languages supplied by the core
distribution.
While this commit is mainly syntax sugar around existing functionality,
future features will rely on having procedures as a separate object
type.
Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
| -rw-r--r-- | doc/src/sgml/ref/create_function.sgml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 75331165fe..fd229d1193 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -55,9 +55,9 @@ CREATE [ OR REPLACE ] FUNCTION <para> If a schema name is included, then the function is created in the specified schema. Otherwise it is created in the current schema. - The name of the new function must not match any existing function + The name of the new function must not match any existing function or procedure with the same input argument types in the same schema. However, - functions of different argument types can share a name (this is + functions and procedures of different argument types can share a name (this is called <firstterm>overloading</firstterm>). </para> @@ -450,7 +450,7 @@ CREATE [ OR REPLACE ] FUNCTION </varlistentry> <varlistentry> - <term><replaceable class="parameter">execution_cost</replaceable></term> + <term><literal>COST</literal> <replaceable class="parameter">execution_cost</replaceable></term> <listitem> <para> @@ -466,7 +466,7 @@ CREATE [ OR REPLACE ] FUNCTION </varlistentry> <varlistentry> - <term><replaceable class="parameter">result_rows</replaceable></term> + <term><literal>ROWS</literal> <replaceable class="parameter">result_rows</replaceable></term> <listitem> <para> @@ -818,7 +818,7 @@ COMMIT; <title>Compatibility</title> <para> - A <command>CREATE FUNCTION</command> command is defined in SQL:1999 and later. + A <command>CREATE FUNCTION</command> command is defined in the SQL standard. The <productname>PostgreSQL</productname> version is similar but not fully compatible. The attributes are not portable, neither are the different available languages. |
