diff options
author | Tom Lane | 2008-12-31 02:25:06 +0000 |
---|---|---|
committer | Tom Lane | 2008-12-31 02:25:06 +0000 |
commit | 26ce4e85a1605326f29e3cb0cc715ddf522a753a (patch) | |
tree | bfd2ca91df26e9aff0873e0c59ce20d3ae096621 /doc/src | |
parent | 8e8854daa2b4b3ef9e3fc1a56c79608a70018058 (diff) |
Add a WINDOW attribute to CREATE FUNCTION, and teach pg_dump about it,
so that user-defined window functions are possible. For the moment you'll
have to write them in C, for lack of any interface to the WindowObject API
in the available PLs, but it's better than no support at all.
There was some debate about the best syntax for this. I ended up choosing
the "it's an attribute" position --- the other approach will inevitably be
more work, and the likely market for user-defined window functions is
probably too small to justify it.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/create_function.sgml | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 639647eab3c..ca9eca5138d 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.83 2008/12/18 18:20:33 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.84 2008/12/31 02:25:03 tgl Exp $ --> <refentry id="SQL-CREATEFUNCTION"> @@ -25,6 +25,7 @@ CREATE [ OR REPLACE ] FUNCTION [ RETURNS <replaceable class="parameter">rettype</replaceable> | RETURNS TABLE ( <replaceable class="parameter">colname</replaceable> <replaceable class="parameter">coltype</replaceable> [, ...] ) ] { LANGUAGE <replaceable class="parameter">langname</replaceable> + | WINDOW | IMMUTABLE | STABLE | VOLATILE | CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT | [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER @@ -242,6 +243,20 @@ CREATE [ OR REPLACE ] FUNCTION </varlistentry> <varlistentry> + <term><literal>WINDOW</literal></term> + + <listitem> + <para> + <literal>WINDOW</literal> indicates that the function is a + <firstterm>window function</> rather than a plain function. + This is currently only useful for functions written in C. + The <literal>WINDOW</> attribute cannot be changed when + replacing an existing function definition. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><literal>IMMUTABLE</literal></term> <term><literal>STABLE</literal></term> <term><literal>VOLATILE</literal></term> |