Subject Re: [firebird-support] Constraint too big
Author Geoff Worboys
> I'm trying to create a primary key with a VARCHAR(255) field
> and I get error msg 335544351 "key size too big for index".
> Is there any way to increase the size of constraints to allow
> me to do this?

FB v1.5 and previous have an index size limit of 252 _bytes_.
FB v2 (now in alpha) says that it has removed that limit.

Regardless - I suggest you think seriously about whether you
really want a primary key using such a field. A surrogate
key is often better (although not all DB developers agree).

If you do use a surrogate key then you:
- have a choice about whether the varchar(255) needs
indexing or not
- could create a non-unique index based on a duplicate
field that carries only a portion of the 255 field and
then ensure uniqueness in a trigger

--
Geoff Worboys
Telesis Computing