Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Christopher Kings-Lynne
Sent: Monday, August 19, 2002 11:22 PM Subject: Re: [SQL] recursive function returning "setof" > > Thanx Chris, > > but I can't find it. > My Programmer's Guide (.../pgsql/doc/html/xfunc-sql.html) says > >"12.2. Query Language (SQL) Functions >

Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Fritz Lehmann-Grube
Thanx Chris, but I can't find it. My Programmer's Guide (.../pgsql/doc/html/xfunc-sql.html) says "12.2. Query Language (SQL) Functions SQL functions execute an arbitrary list of SQL statements," Nothing about control structures in SQL functions additional to the normal command-line syn

Re: [SQL] recursive function returning "setof"

2002-08-19 Thread Christopher Kings-Lynne
> The problem is: > A SQL-Function cannot be recursive because it cannot call itself, and it can > perform no loops. > A PLPGSQL-Function cannot return sets. It can perform loops. Check the manual- you can do FOR and WHILE loops. 7.3 will be able to return sets from PLPGSQL funcs it seems. Chri

[SQL] recursive function returning "setof"

2002-08-19 Thread Fritz Lehmann-Grube
Hello all, I'd like to create a recursive function returning a "setof". See the following situation: CREATE TABLE sections( is serial, data text, contained_in int NOT NULL REFERENCES sections(id) DEFERRABLE ); INSERT INTO sections VALUES(0,'ROOTSECTION',0) I have trig