Re: Recursive plpgsql function in rule

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Recursive plpgsql function in rule
Дата
Msg-id 49EB24BE.2080109@enterprisedb.com
обсуждение исходный текст
Ответ на Recursive plpgsql function in rule  (mito <milos.orszag@gmail.com>)
Список pgsql-hackers
mito wrote:
> I am trying to select subtree by parent id in table:
> 
> create table categories(
>     id int,
>     parent_id int
> );
> 
> I am fetching it by recursive plpgsql function, which works well.
> 
> When i use that function as part of rule operation, i am getting ERROR: 
>  stack depth limit exceeded.
> 
> I have tried to rewrite without recursion which cause infinite loop in 
> rule.
> 
> Is it possible to sent dynamic structures in planer?
> Or how to fetch subtree without change of table structure inside rule?

I didn't quite understand the issue, but as a general hint you might 
want to look at PG 8.4 beta which introduces support for recursive 
queries using the SQL standard WITH syntax. That's very useful when 
dealing with tree structures.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: mito
Дата:
Сообщение: Reference on partial data
Следующее
От: Stefan Kaltenbrunner
Дата:
Сообщение: planner crash/assert hit in 8.4B1