Sent: 05 July 2005 06:05
To: pgsql-sql@postgresql.org
Subject: [SQL] Recursive function
Hi,
I have a table with the following details.
section_type_id | section_type_name | parent_section_type_id
-+---+
10 | Unit
age-
> From: [EMAIL PROTECTED]
> Sent: Mon, 4 Jul 2005 21:05:25 -0800
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Recursive function
>
> Hi,
>
> I have a table with the following details.
>
> section_type_id | section_t
Hi,
I have a table with the following details.
section_type_id | section_type_name | parent_section_type_id
-+---+
10 | Unit |
20 | Block | 10
30 | Prac
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