From: | Alban Hertroys <alban(at)magproductions(dot)nl> |
---|---|
To: | "pobox(at)verysmall(dot)org" <pobox(at)verysmall(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: plpgsql handling a set of values |
Date: | 2006-10-10 07:52:28 |
Message-ID: | 452B513C.4020401@magproductions.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
pobox(at)verysmall(dot)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(at)magproductions(dot)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 //
From | Date | Subject | |
---|---|---|---|
Next Message | adam lawrence | 2006-10-10 07:55:16 | Looping through Arrays |
Previous Message | Alban Hertroys | 2006-10-10 07:48:41 | Re: Intentionally produce Errors |