Create an index with a sort condition

From: "sylsau" <sylsau14(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Create an index with a sort condition
Date: 2006-03-29 11:14:13
Message-ID: 1143630853.043754.111900@v46g2000cwv.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I use PostgreSQL 8.1 and I would like create and index on a table's
field with a sort condition on this field.
For example, I have a table named books and I want create an index on
the fields title and id_book with an order by id_book descendant.

I know how to create the index without this condition :

create index book_index on books(id_book, title);

But, I don't know to create this index with the sort condition.
Someone has an idea ?

Thanks to help me.

Sylvain.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-03-29 11:53:08 Re: PostgreSQL's XML support comparison against other RDBMSes
Previous Message Stefan Fink 2006-03-29 11:03:07 Re: table owner of cloned databases