Re: Summing & Grouping in a Hierarchical Structure

From: Bryan L Nuse <nuse(at)uga(dot)edu>
To: Don Parris <parrisdc(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Summing & Grouping in a Hierarchical Structure
Date: 2013-02-23 16:15:45
Message-ID: 7BEBA741-E416-4000-BE2D-B9196683A2A4@uga.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> That said, now that I have finally gotten the chance to try ltree, I think I like it a lot.

Hello Don,

Yes, after looking at ltree --which I had not done before-- I have to agree with Misa that it looks like the right solution for your problem. That is not to say that "brute force" SQL couldn't provide a workable arrangement; but ltree looks very flexible, especially as it allows you to assign cost values to non-terminal nodes. If it were me, though, I'd still make use of VIEWs to report results of the workhorse queries: staring at a list of items like "Transportation.Bicycle.Gear.Chain_ring" sounds like headache. That's a matter of taste, of course.

Bryan

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Don Parris 2013-02-23 17:53:01 Re: Summing & Grouping in a Hierarchical Structure
Previous Message Don Parris 2013-02-23 15:50:38 Re: Summing & Grouping in a Hierarchical Structure