On Apr 19, 2006, at 14:44 , Martin Kuria wrote:
I have a postgresql database Table Categories which has the
structure like this
Cat_ID | Parent_ID | Name
1 | 0 | Automobiles
2 | 0 | Beauty & Health
3 | 1 | Bikes
4 | 1 | Cars
5 | 3 | Suzuki
6 | 3 | Yamaha
Ian Harding wrote:
You should look up the contrib module ltree which is made for this
sort of thing. If you reinvent the wheel like this, you will be stuck
with 2 levels. With ltree you can have as many as you need and add
more at any time. It lets you query for ancestors and descendants of
an
You should look up the contrib module ltree which is made for this
sort of thing. If you reinvent the wheel like this, you will be stuck
with 2 levels. With ltree you can have as many as you need and add
more at any time. It lets you query for ancestors and descendants of
any item at any level.
Martin Kuria wrote:
Hi,
I have a postgresql database Table Categories which has the structure
like this
Cat_ID | Parent_ID | Name
1 | 0 | Automobiles
2 | 0 | Beauty & Health
3 | 1 | Bikes
4 | 1 | Cars
5 | 3 | Suzuki
6 | 3 | Yamaha
7 | 0 | Clothes
This ha