diff options
Diffstat (limited to 'doc/src/sgml/xaggr.sgml')
-rw-r--r-- | doc/src/sgml/xaggr.sgml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/src/sgml/xaggr.sgml b/doc/src/sgml/xaggr.sgml index 3c4ce19258e..b223888f9ed 100644 --- a/doc/src/sgml/xaggr.sgml +++ b/doc/src/sgml/xaggr.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/xaggr.sgml,v 1.36 2008/11/20 21:10:44 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/xaggr.sgml,v 1.37 2008/12/28 18:53:54 tgl Exp $ --> <sect1 id="xaggr"> <title>User-Defined Aggregates</title> @@ -167,10 +167,13 @@ SELECT attrelid::regclass, array_accum(atttypid::regtype) <para> A function written in C can detect that it is being called as an aggregate transition or final function by seeing if it was passed - an <structname>AggState</> node as the function call <quote>context</>, + an <structname>AggState</> or <structname>WindowAggState</> node + as the function call <quote>context</>, for example by: <programlisting> - if (fcinfo->context && IsA(fcinfo->context, AggState)) + if (fcinfo->context && + (IsA(fcinfo->context, AggState) || + IsA(fcinfo->context, WindowAggState))) </programlisting> One reason for checking this is that when it is true, the first input must be a temporary transition value and can therefore safely be modified |