Subject Re: [firebird-support] Re: Unable to create a table with primary key field as VARCHAR of length 255
Author Thomas Steinmaurer
> Thank you for the prompt response.
>
> Yes, I am using UTF8 as the character set; I need to ensure that the data supports UNICODE and UTF8 fits best with Delphi 7.
>
> I did not know about the restrictions, based upon character length.

You could increase the page size to 8K, thus enlarging the max index key
size. Although I wonder if your primary key contains any semantic, which
can change over time, thus a bad design decision. The only purpose of a
PK should be to uniquely identify a record and reference a record in a
FK relationship.


Regards,
Thomas


> I will keep this in mind for next database.
>
> With many thanks,
> Michael
>
> --- In firebird-support@yahoogroups.com, Mark Rotteveel<mark@...> wrote:
>>
>> On 20-3-2012 16:26, mpp12310 wrote:
>>> Hi,
>>>
>>> When I try to create a table with the Primary Key field being VARCHAR of length 255, and run Compile, I get an error with:
>>>
>>> SQL Code = -607
>>> IBError Number: 335544351
>>>
>>> I checked my Database page size and it is 4096 (default).
>>>
>>> I am running FB Server 2.1.4.18393 on WinXP SP3.
>>>
>>> I am using SQL Manager Lite for Interbase/Firebird and I am using FlameRobin 0.9.3.2188; the error happens on both GUI managers.
>>>
>>> Does anyone else get this error and how did you resolve it?
>>
>> Are you using UTF-8 as a character set? Indices on (VAR)CHAR fields work
>> only for limited lenghts:
>> http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-ddl-index.html#langrefupd25-tbl-max-indexable-strlen
>>
>> For a page size of 4096 it is 253 characters if you use UTF8.
>>
>> Mark
>> --
>> Mark Rotteveel
>>
>
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>