Unique constraint field length limit

Posts   
 
    
scout
User
Posts: 15
Joined: 14-Dec-2007
# Posted on: 09-Apr-2021 21:46:28   

Using LLBLGen 5.4.2, PostgreSQL 12, and .NET Standard 2.0

Running into the unique constraint length > 8k error, the table has two TEXT columns included in the constraint. Seeing if the db administrator can change those two to columns with a practical length. Really just curious where the 8k limit came from, done some searching and haven't found anything.

Thanks again for a terrific product. Richard

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 10-Apr-2021 10:03:25   

Please elaborate a bit on what 'unique constraint length > 8k error' means, is that an error reported by our designer, or by the database and when is it reported?

Frans Bouma | Lead developer LLBLGen Pro
scout
User
Posts: 15
Joined: 14-Dec-2007
# Posted on: 10-Apr-2021 16:37:09   

Reported in the designer's Errors & Warnings when adding a table as an entity. "The field 'Market' in unique constraint 'Tradedupe' in element 'Trade' has an invalid length. Only fields of a length smaller than 8KB are allowed in a Unique Constraint. "

Also mentioned in the "what's new in the 5.0 designer" part of the docs. "An error is now generated when a unique constraint in an entity has a string field with a length of 0 or larger than 8KB."

Not a big deal, dba changed the column widths so all's good. Mostly curious where the limit came from. Thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Apr-2021 07:39:23   

It's a performance thing to keep indices smooth and clean.
https://dba.stackexchange.com/questions/3160/what-are-the-consequences-of-setting-varchar8000.

David Elizondo | LLBLGen Support Team