Re: plpgsql handling a set of values

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: plpgsql handling a set of values
Дата
Msg-id 452B513C.4020401@magproductions.nl
обсуждение исходный текст
Ответ на plpgsql handling a set of values  ("pobox@verysmall.org" <pobox@verysmall.org>)
Ответы Re: plpgsql handling a set of values  ("pobox@verysmall.org" <pobox@verysmall.org>)
Список pgsql-general
pobox@verysmall.org wrote:
> I am writing a plpgsql (PostgreSQL 8.x) trigger function that should do
> something on a number of records. The records are in a very simple table
> with two columns - 'parent_id' and 'child_id'. A 'child' can be as well
> a 'parent' to one or more children - in this case its ID appears as many
> times in the 'parent_id' column as many children it has. The input the
> plpgsql function gets is the ID of the top 'parent'. Then it should find
> all children and do something with them.

I think you should have a look at the ltree contrib package. It
implements tree-like structures, and probably makes your problem much
simpler.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Intentionally produce Errors
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Newbie question about importing text files...