Re: [HACKERS] Recursive SQL functions

2001-10-13 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > I was wondering whether, as a future project, we could make this more > convenient by parsing the body of the function with the binding of the > function already in effect. Seems like a simple rearrangement of the code. First insert the pg_proc entr

[HACKERS] Recursive SQL functions

2001-10-13 Thread Peter Eisentraut
While looking to implement the ODBC replace() function (replace occurences of $2 in $1 by $3), I found that it could be expressed as: CREATE FUNCTION replace(text, text, text) RETURNS text AS ' select case when position($2 in $1) = 0 or char_length($2) = 0 then $1