Re: Sorting with materialized paths

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Sorting with materialized paths
Дата
Msg-id i2h407d949e1005101106hf18cbea6wffdd9ce1d73700e9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sorting with materialized paths  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Sorting with materialized paths  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
On Sun, May 9, 2010 at 4:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ovid <curtis_ovid_poe@yahoo.com> writes:
>> My apologies. This isn't PG-specific, but since this is running on PostgreSQL 8.4, maybe there are specific features
whichmight help. 
>> I have a tree structure in a table and it uses materialized paths to allow me to find children quickly. However, I
alsoneed to sort the results depth-first, as one would expect with threaded forum replies. 
>
> I think contrib/ltree might help you here.  However, it seems to sort
> node names textually rather than numerically, so you might need to
> change it a bit for your own purposes.
>

That's rather unfortunate. Ltree is awfully convenient and it would be
nice to be able to use it.

If you just used plain Postgres arrays of integers you would get the
sorting you want. But you lose all the useful ltree operators for
trees.

--
greg

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Hunsberger
Дата:
Сообщение: Re: Sorting with materialized paths
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: How to do pg_dump + pg_restore within Perl script?