Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Josh Berkus
Dan, Looks good to me. It's the same thing I do for the Celko tree structures in one application -- I have a cache table holding such things as level and parent_id for each node, values which can only be generated from the source tables through slow aggregates. Also, the use of a child table to

Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Dan Langille
On 17 Nov 2002 at 11:39, Dan Langille wrote: > My existing tree implementation reflects the files contained on disk. > The full pathname to a particlar file is obtained from the path to the > parent directory. I am now considering putting this information into > a field in the table. > > Attach

Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Dan Langille
On 20 Nov 2002 at 15:20, Dan Langille wrote: > On 17 Nov 2002 at 14:51, Josh Berkus wrote: > > > Dan, > > > > > My existing tree implementation reflects the files contained on > > > disk. > > > The > > > full pathname to a particlar file is obtained from the path to the > > > parent directory.

Re: [SQL] Trees: maintaining pathnames

2002-11-20 Thread Joe Conway
Dan Langille wrote: Given that I'm considering adding a new field path_name to the tree, I can't see the ltree package will give me anything more than I can get from like. My main reason for adding path_name was doing queries such as: select * from tree where path_name like '/path/to/parent

Re: [SQL] Trees: maintaining pathnames

2002-11-20 Thread Dan Langille
On 17 Nov 2002 at 14:51, Josh Berkus wrote: > Dan, > > > My existing tree implementation reflects the files contained on disk. > > The > > full pathname to a particlar file is obtained from the path to the > > parent > > directory. I am now considering putting this information into a > > field

Re: [SQL] Trees: maintaining pathnames

2002-11-18 Thread Dan Langille
On 18 Nov 2002 at 1:09, [EMAIL PROTECTED] wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > NotDashEscaped: You need GnuPG to verify this message > > > Instead of storing the path in each row, why not let Postgres > take care of computing it with a function? Then make a view > and

Re: [SQL] Trees: maintaining pathnames

2002-11-17 Thread greg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message Instead of storing the path in each row, why not let Postgres take care of computing it with a function? Then make a view and you've got the same table, without all the triggers. CREATE TABLE t

Re: [SQL] Trees: maintaining pathnames

2002-11-17 Thread Josh Berkus
Dan, > My existing tree implementation reflects the files contained on disk. > The > full pathname to a particlar file is obtained from the path to the > parent > directory. I am now considering putting this information into a > field in > the table. > Suggestions, comment, open ridicule, most

[SQL] Trees: maintaining pathnames

2002-11-17 Thread Dan Langille
My existing tree implementation reflects the files contained on disk. The full pathname to a particlar file is obtained from the path to the parent directory. I am now considering putting this information into a field in the table. Attached you will find the pg_dump from my test database (2.4k)