> On Mar 6, 2015, at 9:58 AM, brian [email protected] [firebird-support] 
> <[email protected]> wrote:
> 
> My problem is that I must avoid duplicated records in the database,
> the unique key is a complicated structure containing four 16-bit words
> plus a 108-bit set of flags. The combination of the whole lot must be
> unique. I don't need to retrieve this data other than to check for
> duplicate records, so I can massage it in FreePascal so that it can go
> into the database in any form that's desirable. 

If there's any chance that you'll ever need data fromt the four 16-bit words, 
I'd create a five part primary key with four small integers followed by a 14 
byte string octets.  Firebird index keys are compressed and rearranged so they 
compare bytewise regardless of the original format - single field or multiple, 
combinations of strings and numbers, etc.  If it were me, I'd let Firebird 
create the key from data.
> 
> 
> If I were using PostgreSQL, I'd store the whole lot as a single
> 172-bit bitstring, but I can't find any mention of an equivalent data
> type in the Firebird documentation that I've been able to find. 

String of type octets works.
> 

Good luck,

Ann

Reply via email to