Re: tree ordering with varbit

From: Joe Conway <mail(at)joeconway(dot)com>
To: Scott Lamb <slamb(at)slamb(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tree ordering with varbit
Date: 2002-11-18 16:20:19
Message-ID: 3DD91343.4080403@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Lamb wrote:
> Joe Conway wrote:
>> Scott Lamb wrote:
>>> - I could't see a way to do multi-item sorts, like by score
>>> descending and then post time ascending, for example.
>>
>> If I understand what you're saying correctly, I think you can just
>> join back to the real table from the table function by the primary
>> key. Then you can sort on anything you want.
>
> I'd like to do this but hierarchically also. I.e., sorting based on its
> deepest ancestors score then post time, second deepest's score then post
> time, ..., its score then post time. So I guess in your function's
> language, I'd need to be able to put a couple of columns into the branch
> text.

Ahh, now I understand. This just came up on another list (I think it was the
sql list) -- someone wanted to build a pathname, but is using integer ids to
form the hierarchy. That made me think about an alternative version of the
connectby() function that would allow you to specify a column name to be used
for building something similar to the "branch" field. The "branch" would still
be needed (at least internally) to prevent infinite recursion, so this would
represent additional overhead, and therefore be optional.

It's too late to get functionality changes included in 7.3, but I can make
interim versions available via url. I'll post a message and a link when I get
a chance to address these issues.

Thanks,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Hihn 2002-11-18 16:39:57 Re: Press Release -- Just Waiting for Tom
Previous Message Lee Kindness 2002-11-18 16:09:34 ANN: EMS PostgreSQL Manager 0.94 released!