Thread: recurrence in PL/pgSQL ??!!!!

recurrence in PL/pgSQL ??!!!!

From
Adam Walczykiewicz
Date:
Hi,

I have a table t_categories(nr serial, nr_up integer,name text, ....)
nr_up is a number of category which is one point up to the inserted
category.

and second table t_category_search(nr_ins integer,nr_up)

I try to write Pl/pgsql function using recurrence ....
It should start on insert to t_categories ... (trigger), and create new
rows in t_category_search  :

for_example :  if there is the structure   c1 -----> c2 ----> c3
and I want to create c4 which should be located directly under c3, so  I
want to get in t_category_search

(0,c4),    #0 is the number of max top abstraction category
(c4,c4)
(c4,c1)
(c4,c2)
(c4,c3)

It is possible to use recurrence in PL/pgsql to make such trigger or
there is somo other way to make it on PL/pgsql
Thanks in advance
Adam



--

Jest niezly ... i liscik napisze
OnetKomunikator [ http://ok.onet.pl/instaluj.html ]