Misa & Ben,
Thanks. I guess I overlooked that in the docs. I did see the part about
the 65KB. I don't see my labels getting overly long. I'll be fine with
Herbs_Spices. I make up the labels myself, so it's really no big deal.
Alexander & Bryan - Many thanks for the help!
On Sat, Feb 23, 2
Quoth parri...@gmail.com (Don Parris):
>
> Is it possible to use spaces in the ltree path, like so:
> TOP.Groceries.Food.Herbs & Spices
>
> Or do the elements of the path have to use underscores and dashes?
>From the docs:
| A label is a sequence of alphanumeric characters and underscores (for
Hi Don,
To be honest with you - i dont know - but think it is not...
We use it to solve the problem with hierarchy relations - but it is nowhere
"visible" to users in the app...
Our internal rule is to use ids in ltree structure to solve many others
problems, actually to easy get, actual categor
Misa,
Is it possible to use spaces in the ltree path, like so:
TOP.Groceries.Food.Herbs & Spices
Or do the elements of the path have to use underscores and dashes?
On Sat, Feb 23, 2013 at 7:19 AM, Misa Simic wrote:
> Hi Don,
>
> Yes, its better to use it in category table...
>
> Bryan, how ma
Hi Bryan,
The detailed category listing is dead simple to create: SELECT cat_id,
cat_name, sum(amount) FROM category, line-item GROUP BY cat_name, cat_id;
But... as you say, the result is a LOT of numbers over the course of
160-ish categories of all levels. Which is why it is so important to be
> 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
Hi Bryan,
My current (maybe about to be deprecated now) category table is a recursive
table that I join on the line-item table. Your suggestion of using a table
for each level of category is probably a bit easier to manage in some
respects. However, as you pointed out, it becomes unwieldy when v
Hi Don,
Yes, its better to use it in category table...
Bryan, how many levels there will be - we dont know...
With one table - and ltree is solved all cases...
To add new subcategory user just picks the parent category... So it is easy
to add chain ring to gear... As category...
In another tra
This works fine:
test_ltree=> SELECT path, trans_amt FROM testcat;
path | trans_amt
-+---
TOP.Transportation.Auto.Fuel| 50.00
TOP.Transportation.Auto.Maintenance | 30.00
TOP.Transportati
Ok, I managed to accomplish my goal with the ltree:
test_ltree=> SELECT subltree(path,0,2), sum(trans_amt) FROM testcat GROUP
BY subltree;
subltree | sum
+
TOP.Groceries | 325.00
TOP.Transportation | 180.00
(2 rows)
It took a bit of experimenting wi
Hi Misa,
I decided to try out ltree, and have made some progress with it. If I
understand correctly how to use it, I simply insert the 'path' column into
my table, using ltree as the data type. That eliminates the need for a
category table, if I understand correctly. I just need to ensure the
c
Hi,
Have you considered maybe ltree datatype?
http://www.postgresql.org/docs/9.1/static/ltree.html
I think it solves a lot of problems in topic
Kind regards,
Misa
On Friday, February 15, 2013, Don Parris wrote:
> Hi all,
>
> I posted to this list some time ago about working with a hiera
l.org]
On Behalf Of Don Parris
Sent: Thursday, February 21, 2013 4:38 AM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Summing & Grouping in a Hierarchical Structure
Hi Alexander,
I appreciate you taking time to reply to my post. I like the idea of the
WITH RECURSIVE query, but... The two
ql-sql-ow...@postgresql.org] On Behalf Of Don Parris
> > Sent: Thursday, February 14, 2013 8:58 PM
> > To: pgsql-sql@postgresql.org
> > Subject: [SQL] Summing & Grouping in a Hierarchical Structure
> >
> > Hi all,
> > I posted to this list some time ago about work
ql-ow...@postgresql.org] *On Behalf Of *Don Parris
> *Sent:* Thursday, February 14, 2013 7:58 PM
> *To:* pgsql-sql@postgresql.org
> *Subject:* [SQL] Summing & Grouping in a Hierarchical Structure
>
> ** **
>
> Hi all,
>
> I posted to this list some time ago abou
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
> On Behalf Of Don Parris
> Sent: Thursday, February 14, 2013 8:58 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Summing & Grouping in a Hierarchical Structure
>
> Hi all,
> I poste
TE for each category and then
aggregate the individual CTEs.
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of Don Parris
Sent: Thursday, February 14, 2013 7:58 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Summing & Grouping in a Hierarchical
Hi all,
I posted to this list some time ago about working with a hierarchical
category structure. I had great difficulty with my problem and gave up
for a time. I recently returned to it and resolved a big part of it. I
have one step left to go, but at least I have solved this part.
Here is t
18 matches
Mail list logo