Search Postgresql Archives

Re: plpgsql handling a set of values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pobox@xxxxxxxxxxxxx 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@xxxxxxxxxxxxxxxxx

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 //


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux