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
>
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
> 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
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