Re: indices and casts - Mailing list pgsql-admin

From Tom Lane
Subject Re: indices and casts
Date
Msg-id 24903.1097533924@sss.pgh.pa.us
Whole thread Raw
In response to indices and casts  (Rosser Schwarz <rosser.schwarz@gmail.com>)
Responses Re: indices and casts  (Rosser Schwarz <rosser.schwarz@gmail.com>)
List pgsql-admin
Rosser Schwarz <rosser.schwarz@gmail.com> writes:
> Is it possible to do something functionally equivalent to "CREATE
> INDEX name ON table USING btree(column::date)"?  That statement yields
> a syntax error on the "::".

CREATE INDEX name ON table USING btree((column::date))

See the docs concerning indexes on expressions (formerly called
functional indexes).  The parens are needed to avoid syntactic ambiguity
associated with the optional opclass name ...

            regards, tom lane

pgsql-admin by date:

Previous
From: Rosser Schwarz
Date:
Subject: indices and casts
Next
From: Rosser Schwarz
Date:
Subject: Re: indices and casts