Hello,
I have a table like this:
id parent_id
-----------------------
1 null
2 1
3 1
4 2
5 2
6 2
7 3
etc....
and I'd like to write a function get_children(int) that returned the set
of children for the id passed in as $1.
This will be a recursive function, and I did find a recent newsgroup
post (I think originally from the HACKERS
list) about how to implement recursive SQL functions in Postgres, but
I'm not sure how to go about building the
result set as I go. Does it involve the creation of a temporary table
to hold the results?
Thanks,
Fran