Hi,
i searched the docs and the archives and was really wondering that i have not
found anything searching for "functional index primary key".
i would like to have a table of members with nicknames which are
case-insensitive but i would like to save the user given name case-sensitive
to display 'JimKnopf' instead of 'jimknopf':
CREATE TABLE members (
nickname text NOT NULL,
CONSTRAINT pk_test PRIMARY KEY (lower(name))
);
psql:scratch.sql:7: ERROR: syntax error at or near "(" at character 92
Of course i can use an index like this:
CREATE TABLE members (
nickname text NOT NULL,
);
CREATE UNIQUE INDEX ix_name ON test (lower(name));
but the key isn't marked as primary then.
So here is my question: How can i define a functional index to be used with a
primary key (using postgreSQL 7.4.3)?
can anybody help me with this problem or give me a link to a archived mail
about this topic?
kind regards,
janning