lower(varchar) - Mailing list pgsql-general

From Maarten Boekhold
Subject lower(varchar)
Date
Msg-id Pine.SUN.3.91.980813112531.20631F-100000@dutepp0.et.tudelft.nl
Whole thread Raw
List pgsql-general
Hi,

I just tried to create a functional index on a varchar column, which
failed, cos lower() is not defined on varchars. I guess it's only
supported for text columns (aren't they treated the same way internally?).

So, I figured, let's cast the varchar to a text type:

create index product_artit_idx2 on product (lower(artit::text) text_ops);
ERROR:  parser: parse error at or near "::"

How can I do this? Isn't there a simple fix to some system table that
tells postgres that using lower() on varchar is OK?

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems  |
|                   Department of Electrical Engineering                    |
|           Computer Architecture and Digital Technique section             |
|                          M.Boekhold@et.tudelft.nl                         |
-----------------------------------------------------------------------------


pgsql-general by date:

Previous
From: Aleksey Dashevsky
Date:
Subject: Re: [GENERAL] designating a column as primary key after creation
Next
From: "Oosterloo, Robert-Jan"
Date:
Subject: Postgresql Full text search?