Re: CREATE INDEX question (how to index on "money" field?) - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: CREATE INDEX question (how to index on "money" field?)
Date
Msg-id 3F89B901.8020307@bigfoot.com
Whole thread Raw
List pgsql-general
Stephane Charette wrote:

> QUICK VERSION:  How do I create an index on a field of type "MONEY"?
>
> -----------------------------
> LONG VERSION:
>
> I have a table with a field of type "money".  I very often need to
> access records by the purchase price so I thought I'd create an index
> to help out my selects:
>
>    CREATE INDEX purchasepriceidx ON mytable (purchaseprice);

It's working on 7.4:

Welcome to psql 7.4beta3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help on internal slash commands
        \g or terminate with semicolon to execute query
        \q to quit

kalman=# create table test( a money );
CREATE TABLE
kalman=# create index idx on test (a );
CREATE INDEX





Regards
Gaetano Mendola


















pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: [PERFORM] go for a script! / ex: PostgreSQL vs. MySQL
Next
From: Martin Marques
Date:
Subject: Re: need for concrete info