primary key on lower(varchar) - Mailing list pgsql-novice

From
Subject primary key on lower(varchar)
Date
Msg-id 0cfb01c61321$3b6d86c0$0201a8c0@iwing
Whole thread Raw
Responses Re: primary key on lower(varchar)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
hi list
 
why can't i define a primary key on a varchar field as being lower(field)?
 
i'm getting the following error:
 
ERROR:  syntax error at or near "(" at character 94:   PRIMARY KEY ((lower(e_name) ));
 
 
here's the sql script:
 
ALTER TABLE "oldtables"."lexikon_entries"
  DROP CONSTRAINT "lexikon_entries_pkey" RESTRICT;
 
ALTER TABLE "oldtables"."lexikon_entries"
  ADD CONSTRAINT "lexikon_entries_pkey"
  PRIMARY KEY ((lower(e_name) ));
 
ALTER INDEX "oldtables"."lexikon_entries_pkey"
  OWNER TO "db_outnow";
 
 
this seems to work for normal indices... do i really have to create a 2nd index on the same field?
 
- thomas
 

pgsql-novice by date:

Previous
From:
Date:
Subject: SQL Question
Next
From: Michael Fuhr
Date:
Subject: Re: SQL Question