List:General Discussion« Previous MessageNext Message »
From:Reverend Deuce Date:December 8 2003 3:53pm
Subject:Re: primary key type is BLOB
View as plain text  

When you refer to a column as a primary key, I tend to think that this key
will be your main "relationship" point to the data in your table. Now, when
you combine the primary key concept with a BLOB (binary large object), it
seems to me that you are almost defeating the purpose of a primary key
(you'd be making the index basically useless). I have never heard of anybody
making a BLOB a primary key, so I could not comment on whether or not it is
actually do-able or possible with MySQL. If it is, it shouldn't be.

I would recommend you focus your design on creating inter-table
relationships based around smaller keys that index well, such as integers
and keep the BLOBs in a separate table, away from your frequently read data.

-- R.

----- Original Message ----- 
From: "Lemasson Sylvain" <s.lemasson@stripped>
To: <mysql@stripped>
Sent: Monday, December 08, 2003 8:23 AM
Subject: primary key type is BLOB

I try to add a primary key on a BLOB column and I have got an error (ERROR
1170: BLOB column 'value5' used in key specification without a key length).
May be the answer is in the documentation but I did not find it. So how
could I make my BLOB column a primary key?

Lemasson Sylvain
Ingénieur développeur
Paris Nord 2 - 13, rue de la Perdrix
BP 50035-95946 Roissy CDG Cédex

primary key type is BLOBLemasson Sylvain8 Dec
  • Re: primary key type is BLOBMartijn Tonies8 Dec
  • Re: primary key type is BLOBEgor Egorov8 Dec
  • Re: primary key type is BLOBReverend Deuce8 Dec