Re: LTREE extension and "order by"

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: cgourofino(at)hotmail(dot)com
Cc: Ivan Polak <ivan(dot)polak(at)f4s(dot)sk>, pgsql-sql(at)postgresql(dot)org
Subject: Re: LTREE extension and "order by"
Date: 2011-07-21 16:48:00
Message-ID: CAFj8pRB7VPoHf7=2EpLrquY8r7ZryLBiR5WJu56RFqcQZ2J85Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2011/7/21 Carla <cgourofino(at)hotmail(dot)com>:
> Hmm, I'm using PostgreSQL 8.4 and it worked.
> Try to use the function ltree2text instead of ::text.
> select * from comments where article_id = 2 order by
> cast(string_to_array(ltree2text(path),'.') as integer[]);
>

this does not work in older versions

you can use http://www.pgsql.cz/index.php/PostgreSQL_SQL_Tricks#Cast_to_varchar

Regards

Pavel Stehule

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ivan Polak 2011-07-21 17:31:21 Re: LTREE extension and "order by"
Previous Message Carla 2011-07-21 16:28:42 Re: LTREE extension and "order by"