Re: AW: [PEAR-DEV] DB_NestedSet_MDB useless
| From: | Jeroen Houben | Date: | Tue, 01 Jul 2003 14:32:52 +0000 |
| Subject: | Re: AW: [PEAR-DEV] DB_NestedSet_MDB useless | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17899@lists.php.net to get a copy of this message | ||
Daniel Khan wrote:
Hello Jeroen,I think I use a differnt approach for my tree so maybe I'm not using a nested set tree. I have the following table : CREATE TABLE "sections" ( "section_id" SMALLINT DEFAULT nextval('sections_id_seq'::text) NOT NULL, "parent_id" SMALLINT DEFAULT 0 NOT NULL, "name" VARCHAR(150) DEFAULT '' NOT NULL, "info" VARCHAR(255), "url" VARCHAR(150) DEFAULT 'documents/' NOT NULL, "urltarget" VARCHAR(8) DEFAULT '_self' NOT NULL, "displayorder" SMALLINT DEFAULT 0 NOT NULL, PRIMARY KEY("section_id"), CHECK (parent_id >= 0), CHECK (displayorder >= 0), FOREIGN KEY ("parent_id") REFERENCES "sections"("section_id") ON DELETE CASCADE ON UPDATE CASCADE NOT DEFERRABLE ) WITH OIDS; Can I make that work with nestedset? TIA Jeroen p.s. I almost have the whole tree thing working without using PHP, just using foreign keys and stored procedures in Postgres, but I can't retrieve ordered trees using stored procedures yet. The postgres documentation is very limited for in that area. I was rold to use cursors, but that's where it all got a bit beyond me :-)A bit offtopic, but I'd like to know the difference between nested set and PEAR::Tree. Can someone elaborate on this please?That's only my point of view: http://oss.webcluster.at/ Link to introduction. Thanks for the info. I use PEAR::Tree at the moment, and it works fine so there really is no need for me to switch to a different backend, but I lighter package that only deals with DB's would be better for my specific case. Also PEAR::Tree is still beta so I guess it's always better to find a stable package. However the link you sent me says PEAR::DB_NestedSet can only be used with MySql. Is that true? Surely if is uses PEAR::DB it must be able to handle PostgreSQL as well.