aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/xfunc.sgml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/xfunc.sgml')
-rw-r--r--doc/src/sgml/xfunc.sgml31
1 files changed, 30 insertions, 1 deletions
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index 20341077c9c..94c664cbce1 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.47 2002/01/20 22:19:56 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.48 2002/03/05 05:33:00 momjian Exp $
-->
<chapter id="xfunc">
@@ -1297,6 +1297,35 @@ concat_text(PG_FUNCTION_ARGS)
</para>
<para>
+ Other options provided in the new-style interface are two
+ variants of the
+ <function>PG_GETARG_<replaceable>xxx</replaceable>()</function>
+ macros. The first of these,
+ <function>PG_GETARG_<replaceable>xxx</replaceable>_COPY()</function>
+ guarantees to return a copy of the specified parameter which is
+ safe for writing into. (The normal macros will sometimes return a
+ pointer to the value which must not be written to. Using the
+ <function>PG_GETARG_<replaceable>xxx</replaceable>_COPY()</function>
+ macros guarantees a writable result.)
+ </para>
+
+ <para>
+ The second variant consists of the
+ <function>PG_GETARG_<replaceable>xxx</replaceable>_SLICE()</function>
+ macros which take three parameters. The first is the number of the
+ parameter (as above). The second and third are the offset and
+ length of the segment to be returned. Offsets are counted from
+ zero, and a negative length requests that the remainder of the
+ value be returned. These routines provide more efficient access to
+ parts of large values in the case where they have storage type
+ "external". (The storage type of a column can be specified using
+ <command>ALTER TABLE <repaceable>tablename</replaceable> ALTER
+ COLUMN <replaceable>colname</replaceable> SET STORAGE
+ <replaceable>storagetype</replaceable>. Storage type is one of
+ plain, external, extended or main.)
+ </para>
+
+ <para>
The version-1 function call conventions make it possible to
return <quote>set</quote> results and implement trigger functions and
procedural-language call handlers. Version-1 code is also more