Forum OpenACS Development: Creating a recursive function using "create or replace"

Collapse
Posted by David Walker on
Just in case postgres 7.2 doesn't support recursive functions
directly I'll add this note on creating recursive functions using
"create or replace".

To use "create or replace" to create a recursive function you first
issue a create function command that returns the proper content type
but is not recursive.  Then you replace that function using "create
or replace" with the final version that is recursive.

It might be considered a hack but it isn't too bad, especially
compared to the hack I did to get recursive functions into PG 7.1
(although that one could be worse.  I did not have to edit any
source code to do it).

Hopefully they'll just support recursive functions directly and we
won't have any trouble.