aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-23 16:41:38 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-23 16:41:38 +0000
commita2a3192802e12e056806d5921c3fc4a7a6df8b09 (patch)
treee10ac75a39d8429235b9d994356ca27d62c81005 /doc/src
parentcf7ee638a742474f92d40c0d6f1326bb8b06506e (diff)
downloadpostgresql-a2a3192802e12e056806d5921c3fc4a7a6df8b09.tar.gz
postgresql-a2a3192802e12e056806d5921c3fc4a7a6df8b09.zip
Further cleanup around the edges of OPAQUE/pseudotype changes. Correct
the declarations of some index access method support functions. Support SQL functions returning VOID.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/xfunc.sgml18
1 files changed, 11 insertions, 7 deletions
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index 9b7c42d251f..a38305ce0bc 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.55 2002/08/22 00:01:40 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.56 2002/08/23 16:41:37 tgl Exp $
-->
<chapter id="xfunc">
@@ -170,22 +170,26 @@ CREATE FUNCTION tp1 (integer, numeric) RETURNS numeric AS '
<command>DELETE</command>) as well
as <command>SELECT</command> queries. However, the final command
must be a <command>SELECT</command> that returns whatever is
- specified as the function's return type.
+ specified as the function's return type. Alternatively, if you
+ want to define a SQL function that performs actions but has no
+ useful value to return, you can define it as returning <type>void</>.
+ In that case it must not end with a <command>SELECT</command>.
+ For example:
<programlisting>
-CREATE FUNCTION clean_EMP () RETURNS integer AS '
+CREATE FUNCTION clean_EMP () RETURNS void AS '
DELETE FROM EMP
WHERE EMP.salary &lt;= 0;
- SELECT 1 AS ignore_this;
' LANGUAGE SQL;
SELECT clean_EMP();
</programlisting>
<screen>
- x
----
- 1
+ clean_emp
+-----------
+
+(1 row)
</screen>
</para>