Hierarchical database?

Discussion in 'MySQL' started by rodney88, Jan 7, 2007.

  1. #1
    I've spent a few days working on a directory type script and come across the common problem of how best to store the tree structure in mySQL.

    I've found plenty of resources that are great at explaining the theory but kinda lacking in the how to add/delete/move nodes examples. I've got as far as being able to modify the structure fairly easily - as in add and delete leaf nodes. Deleting nodes with children, moving nodes, etc. is a bit beyond me.

    Which brings me to my question - I want to store a category tree structure in a database but which (free) ones can I use? I've tried searching but no luck so far..

    Many thanks..
     
    rodney88, Jan 7, 2007 IP
  2. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Postgres would be ideal. It's built in refferential integrity makes something like this nice and simple.
     
    tandac, Jan 7, 2007 IP
  3. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the advice. I'll give postgres a look and see what I can come up with..
     
    rodney88, Jan 8, 2007 IP